Essa - Multi-Timeframe LevelsEnhanced Multi‐Timeframe Levels
This indicator plots yearly, quarterly and monthly highs, lows and midpoints on your chart. Each level is drawn as a horizontal line with an optional label showing “ – ” (for example “Apr 2025 High – 1.2345”). If two or more timeframes share the same price (within two ticks), they are merged into a single line and the label lists each timeframe.
A distance table can be shown in any corner of the chart. It lists up to five active levels closest to the current closing price and shows for each level:
level name (e.g. “May 2025 Low”)
exact price
distance in pips or points (calculated according to the instrument’s tick size)
percentage difference relative to the close
Alerts can be enabled so that whenever price comes within a user-specified percentage of any level (for example 0.1 %), an alert fires. Once price decisively crosses a level, that level is marked as “broken” so it does not trigger again. Built-in alertcondition hooks are also provided for definite breaks of the current monthly, quarterly and yearly highs and lows.
Monthly lookback is configurable (default 6 months), and once the number of levels exceeds a cap (calculated as 20 + monthlyLookback × 3), the oldest levels are automatically removed to avoid clutter. Line widths and colours (with adjustable opacity for quarterly and monthly) can be set separately for each timeframe. Touches of each level are counted internally to allow future extension (for example visually emphasising levels with multiple touches).
Penunjuk dan strategi
HARSI PRO v2 - Advanced Adaptive Heikin-Ashi RSI OscillatorThis script is a fully re-engineered and enhanced version of the original Heikin-Ashi RSI Oscillator created by JayRogers. While it preserves the foundational concept and visual structure of the original indicatorusing Heikin-Ashi-style candles to represent RSI movementit introduces a range of institutional-grade engines and real-time analytics modules.
The core idea behind HARSI is to visualize the internal structure of RSI behavior using candle representations. This gives traders a clearer sense of trend continuity, exhaustion, and momentum inflection. In this upgraded version, the system is extended far beyond basic visualization into a comprehensive diagnostic and context-tracking tool.
Core Enhancements and Features
1. Heikin-Ashi RSI Candles
The base HARSI logic transforms RSI values into open, high, low, and close components, which are plotted as Heikin-Ashi-style candles. The open values are smoothed with a user-controlled bias setting, and the high/low are calculated from zero-centered RSI values.
2. Smoothed RSI Histogram and Plot
A secondary RSI plot and histogram are available for traditional RSI interpretation, optionally smoothed using a custom midpoint EMA process.
3. Dynamic Stochastic RSI Ribbon
The indicator optionally includes a smoothed Stochastic RSI ribbon with directional fill to highlight acceleration and reversal zones.
4. Real-Time Meta-State Engine
This engine determines the current market environmentneutral, breakout, or reversalbased on multiple adaptive conditions including volatility compression, momentum thrust, volume behavior, and composite reversal scoring.
5. Adaptive Overbought/Oversold Zone Engine
Instead of using fixed RSI thresholds, this engine dynamically adjusts OB/OS boundaries based on recent RSI range and normalized price volatility. This makes the OB/OS levels context-sensitive and more accurate across different instruments and regimes.
6. Composite Reversal Score Engine
A real-time score between 0 and 5 is generated using four components:
* OB/OS proximity (zone score)
* RSI slope behavior
* Volume state (burst or exhaustion)
* Trend continuation penalty based on position versus trend bias
This score allows for objective filtering of reversal zones and breakout traps.
7. Kalman Velocity Filter
A Kalman-style adaptive smoothing filter is applied to RSI for calculating velocity and acceleration. This allows for real-time detection of stalls and thrusts in RSI behavior.
8. Predictive Breakout Estimator
Uses ATR compression and RSI thrusting conditions to detect likely breakout environments. This logic contributes to the Meta-State Engine and the Breakout Risk dashboard metric.
9. Volume Acceleration Model
Real-time detection of volume bursts and fades based on VWMA baselines. Volume exhaustion warnings are used to qualify or disqualify reversals and breakouts.
10. Trend Bias and Regime Detection
Uses RSI slope, HARSI body impulse, and normalized ATR to classify the current trend state and directional bias. This forms the basis for filtering false reversals during strong trends.
11. Dashboard with Tooltips
A clean, table displays six key metrics in real time:
* Meta State
* Reversal Score
* Trend Bias
* Volume State
* Volatility Regime
* Breakout Risk
Each cell includes a descriptive tooltip explaining why the value is being shown based on internal state calculations.
How It Works Internally
* The system calculates a zero-centered RSI and builds candle structures using high, low, and smoothed open/close values.
* Volatility normalization is used throughout the script, including ATR-based thresholds and dynamic scaling of OB/OS zones.
* Momentum is filtered through smoothed slope calculations and HARSI body size measurements.
* Volume activity is compared against VWMA using configurable multipliers to detect institutional-level activity or exhaustion.
* Each regime detection module contributes to a centralized metaState classifier that determines whether the environment is conducive to reversal, breakout, or neutral action.
* All major signal and context values are continuously updated in a dashboard table with logic-driven color coding and tooltips.
Based On and Credits
This script is based on the original Heikin-Ashi RSI Oscillator by JayRogers . All visual elements from the original version, including candle plotting and color configurations, have been retained and extended. Significant backend enhancements were added by AresIQ for the 2025 release. The script remains open-source under the original attribution license. Credit to JayRogers is preserved and required for any derivative versions.
PMO Crossover Screener Filtertrying to create a screener filter that finds where the POM crosses positively over the 55 DMA
The LEAP Contest - Symbol & Max Position Table TrackerDescription:
This indicator tracks the maximum contracts allowed to be traded for TradingView’s *"The Leap"* Contest. It displays a horizontal table at the bottom right of your chart showing up to 20 symbols along with their maximum allowable open contract positions.
Use case:
Designed specifically for traders participating in *The Leap* Contest on TradingView.
Users need to enter the symbol and the maximum contracts allowed for that symbol in the settings menu for each new contest.
It provides a quick reference to ensure compliance with contest rules on maximum position sizes.
How it works:
The table shows two rows: the top row displays the symbol name, and the bottom row shows the max contract limit.
If the currently loaded chart symbol matches any symbol in the list, its text color changes to yellow .
Customization:
Symbols and limits must be updated in the indicator’s settings before each contest to reflect the current rules.
VWAP 14 & EMA 8 RibbonIndicator that shows when 8 EMA crosses the VWAP 14. I have found this cross to be very bullish on the weekly timeframe. The VWAP 14 on its own serves as a good support and resistance as well. Very effective on the daily as well and even the 4 hour timeframe.
Interpolated Median Volatility LSMA | OttoThis indicator combines trend-following and volatility analysis by enhancing traditional LSMA with percentile-based linear interpolation applied to both the Least Squares Moving Average (LSMA) and standard deviation. Rather than relying on raw values, it uses the interpolated median (50th percentile) to smooth out noise while preserving sensitivity to significant price shifts. This approach produces a cleaner trend signal that remains responsive to real market changes, adapts to evolving volatility conditions, and improves the accuracy of breakout detection.
Core Concept
The indicator builds on these core components:
LSMA (Least Squares Moving Average): A linear regression-based moving average that fits line using user selected source over user defined period. It offers a smoother and more reactive trend signal compared to standard moving averages.
Standard Deviation shows how much price varies from the mean. In this indicator, it’s used to measure market volatility.
Volatility Bands: Instead of traditional Bollinger-style bands, this script calculates custom upper and lower bands using percentile-based linear interpolation on both the LSMA and standard deviation. This method produces smoother bands that filter out noise while remaining adaptive to meaningful price movements, making them more aligned with real market behavior and helping reduce false signals.
Percentile interpolation estimates a specific percentile (like the median — the 50th percentile) from a set of values — even when that percentile doesn't fall exactly on one data point. Instead of selecting a single nearest value, it calculates a smoothed value between nearby points. In this script, it’s used to find the median of past LSMA and standard deviation values, reducing the impact of outliers and smoothing the trend and volatility signals for more robust results.
Signal Logic: A long signal is identified when close price goes above the upper band, and a short signal when close price goes below the lower band.
⚙️ Inputs
Source: The price source used in calculations
LSMA Length: Period for calculating LSMA
Standard Deviation Length: Period for calculating volatility
Percentile Length: Period used for interpolating percentile values of LSMA and standard deviation
Multiplier: Controls the width of the bands by scaling the interpolated standard deviation
📈 Visual Output
Colored LSMA Line: Changes color based on signal (green for bullish, purple for bearish)
Upper & Lower Bands: Volatility bands calculated using interpolated values (green for bullish, purple for bearish)
Bar Coloring: Price bars are colored to reflect signal state (green for bullish, purple for bearish)
Optional Candlestick Overlay: Enhances visual context by coloring candles to match the signal state (green for bullish, purple for bearish)
How to Use
Add the indicator to your chart and look for signals when close price goes above or below the bands.
Long Signal: close Price goes above the upper band
Short Signal: close Price goes below the lower band
🔔 Alerts:
This script supports alert conditions for long and short signals. You can set alerts based on band crossovers to be notified of potential entries/exits.
⚠️ Disclaimer:
This indicator is intended for educational and informational purposes only. Trading/investing involves risk, and past performance does not guarantee future results. Always test and evaluate strategies before applying them in live markets. Use at your own risk.
PMO Crossover ScreenerThis script searches for the timeframes where the PMO (Price Momentum Oscillator) makes a positive move over the 55 day moving average.
EMA Cross Bar Color SignalThis was created for my trader friends in our Discord community, and it's free of charge.
Smart Trend Zones + EMAs 20/50/200 + Cross SignalsIndicator for trand up and down including Rsi Macd and other indicators
CVD with Buy/Sell Volume HistogramThis custom indicator visualizes Cumulative Volume Delta (CVD) alongside a buy/sell volume histogram to help traders analyze market pressure more effectively.
Cumulative Volume Delta (CVD) measures the net difference between estimated buying and selling volume over a user-defined number of bars (default: 48 bars).
Buy/Sell Volume Histogram plots:
🟩 Buy Volume as green columns (when close > open),
🟥 Sell Volume as red columns (when close < open),
⚪ Optional gray bars for neutral candles (close = open).
This tool helps detect shift in order flow, momentum exhaustion, or volume absorption, particularly useful for scalping, intraday trading, and volume-based analysis on lower timeframes.
Futures Margin Lookup TableThis script applies a table to the upper right corner of the screen, which provides the intraday and overnight margin requirements of the currently selected symbol.
In this indicator the user must provide the broker data in the form of specifically formatted text blocks. The data for which should be found on the broker website.
The purpose for it's creation is due to the non-standard way each individual broker may price their margins and lack of information within TradingView when connected to some (maybe all) brokers, including when paper trading, as the flat percentage rule is not accurate.
An example of information for NinjaTrader could look like this
MES;Micro S&P;$50;$2406
ES;E-Mini S&P;$500;$24,053
GC;Gold;$500;$16500
NQ;E-Mini Nasdaq;$1,000;$34,810
FDAX;Dax Index;€2,000;€44,311
Each symbol begins a new line, and the values on that line are separated by semicolons (;)
Each line consists of the following...
SYMBOL : Search string used to match to the beginning of the current chart symbol.
NAME: Human readable name
INTRA: Intraday trading margin requirement per contract
OVERNIGHT: Overnight trading margin requirement per contract
The script simply finds a matching line within your provided information using the current chart symbol.
So for example the continuous chart for NQ1! would match to the user specified line starting with NQ... as would the individual contract dates such as NQM2025, NQK2025, etc.
NOTES:
There is a possibility that symbols with similar starting characters could match.
If this is the case put the longer symbol higher in the list.
There is also a line / character limit to the text input fields within pinescript
Ensure the text you paste into them is not truncated.
If so there are 3 input fields for just this purpose.
Find the last complete line and continue the remaining symbol lines on the subsequent inputs.
ATR-InfoWHAT IT SHOWS
- ATR (): Average True Range of the chosen timeframe, printed with the instrument’s native tick precision (format.mintick).
- ATR % PRICE: ATR divided by the latest close, multiplied by 100 – the range as a percentage of current price.
- LEN / TF: The ATR length and timeframe you selected (shown in small print).
INPUTS
- ATR Length (default 14)
- ATR Timeframe (for example 60, D, W)
- Design settings: table position, font size, colours, border
EXAMPLES
BTC-USD: price 67 800, ATR 2 450, ATR % 3.6
NQ E-Mini: price 18 230, ATR 355, ATR % 1.9
CL WTI: price 76.40, ATR 2.10, ATR % 2.8
EUR-USD: price 1.0860, ATR 0.0075, ATR % 0.69
USE CASES
Volatility-adjusted stops: place your stop roughly one ATR beyond the entry price.
Position sizing: money at risk divided by ATR gives the number of contracts or coins.
Market selection: trade assets only when their ATR % sits in your preferred range.
Strategy filter: trigger entries or exits only when ATR % crosses a chosen threshold.
LIMITS
ATR is descriptive; it does not predict future moves.
Illiquid symbols may show exaggerated ATR spikes.
ATR % ignores differing session lengths (24/7 crypto versus exchange-traded hours).
Rifaat Ultra Gold AI v6.1🔄 SL moves with each new candle if the price moves in favor of the trade.
🟢 Break-Even Protection
If a certain profit percentage is reached, the SL is moved to the entry point (zero loss).
🔕 Audio and Visual Alerts
A sound notification on buy/sell signals.
A visual alert on the screen.
🎛️ Settings Control
Adjustable from the settings menu.
EMA Trend Strength [Enhanced]This script shows the trend of the ticker. It paints five states: when the previous closing price is above 10EMA, which is greater than the 20 EMA, and the 20 EMA is greater than the 50 SMA - Very Bullish. When the previous closing price is above 10EMA and 10EMA is > 20EMA - Bullish. Vice versa for Very Bearish and Bearish. All other states are labelled "Neutral". The script allows you to adjust the background colours and colour and appearance of the MA lines.
Use at your own risk :). No warranty of any kind is provided or implied.
GoatsGlowingRSIGoatsGlowingRSI is a visually enhanced and feature-rich RSI (Relative Strength Index) indicator designed for deeper market insight and clearer signal visualization. It combines standard RSI analysis with gradient-colored backgrounds, glowing effects, and automated divergence detection to help traders spot potential reversals and momentum shifts more effectively.
Key Features:
✅ Multi-Timeframe RSI:
Calculate RSI from any timeframe using the custom input. Leave it blank to use the current chart's timeframe.
✅ Dynamic Gradient Background:
A smooth gradient fill is applied between RSI levels from the lower band (30) to the upper band (70). The gradient shifts from blue (oversold) to red (overbought), visually highlighting the RSI's position and strength.
✅ Glowing RSI Line:
A three-layered glow effect surrounds the main RSI line, creating a striking white core with a purple aura that enhances visibility against dark or light chart themes.
✅ Custom RSI Levels:
Dashed horizontal lines at RSI 70 (overbought), RSI 30 (oversold), and a dotted midline at 50 help you interpret trend momentum and strength.
✅ Automatic Divergence Detection:
Built-in logic identifies bullish and bearish divergences by comparing RSI and price pivot points:
🟢 Bullish Divergence: RSI makes a higher low while price makes a lower low.
🔴 Bearish Divergence: RSI makes a lower high while price makes a higher high.
Divergences are marked on the RSI line with colored lines and labels ("Bull"/"Bear").
✅ Alerts Ready:
Get notified in real-time with alert conditions for both bullish and bearish divergence setups.
Current Ticker Previous Period High/Low LinesThis Indicator will provide you the Daily, Weekly, Monthly, and Yearly High and Low
FX Public [FMWX]💻FX Public Dual Direction Strategy
be sure and check x.com
for post with access codes, they will be public but change from time to time.
A professional-grade strategy designed for **both LONG and SHORT positions**, optimized for ES! Perpetual on the 10-minute timeframe. This dual-direction system is engineered with institutional logic, multi-tier take-profit mechanics, and smart market filters.
---
🧠 Core Features:
• Automatic LONG & SHORT entries
• TP1–TP4 system with realistic partial exits (`strategy.exit` with `qty_percent`)
• Dynamic Stop-Loss with optional Break-Even & Trailing Stop
• Supply & Demand Zone visual mapping
• Trend Pressure + Volatility + Market Session filters
• Institutional session alignment (e.g. New York open/highs)
• Visual overlays for trade clarity
• Real-time trade panel with all key metrics
---
📊 Stats & Filters:
• Win-rate filter (default 82%)
• Trend bias (Bullish, Bearish, Trending, Ranging)
• Market session awareness (Asia, London, New York)
• Volatility detection to avoid low-momentum trades
---
📍 Best For:
• Scalping & Swing Trading
• Smart Money/ICT/SMC traders
• Realistic Risk-Reward management
• Advanced discretionary or semi-automated strategies
---
⚙️ Works on: `S&P, GOLD,SILVER,STOCKS, Crypto`
🕒 Timeframe: `10m` (optimized)
📈 Platform: TradingView Pro+ or Premium recommended
---
🎁 Included:
• Script logic with visual interface
• Entry/Exit mechanics
• Demand/Supply mapping
• Alerts-ready
Nice Trade Dashboard With All Details You need for a successful trade
lbqzhsjhknztbrzctule.supabase.co
Trend and Session Dashboard
lbqzhsjhknztbrzctule.supabase.co
Custom Session Settings
lbqzhsjhknztbrzctule.supabase.co
Many Filters to customize your strategy
lbqzhsjhknztbrzctule.supabase.co
Realtime Strategy Results with trades Built in
lbqzhsjhknztbrzctule.supabase.co
Get Access Today
Store 👇
frameworx.fun
Alpha Group with membership benefits that include all indicator and alpha access 👇
Bridge3Labos bridge3labs.io
FrameWorx Family WIP Crypto Alpha Analytics Site 👇
FrameWorx Crypto Analytics frameworx.site
Built by @famework.fun 🔧
WLSMA: fast approximation🙏🏻 Sup TV & @alexgrover
O(N) algocomplexity, just one loop inside. No, you can't do O(1) @ updates in moving window mode, only expanding window will allow that.
Now I have time series & stats models of my own creation, nowhere else available, just TV and my github for now, ain’t no legacy academic industry I always have fun about, but back in 2k20 when I consciously ain’t known much about quant, I remember seeing post by @alexgrover recreating Moving Regression Endpoint dropped on price chart (called LSMA here) as a linear filter combination of filters (yea yeah DSP terms) as 3WMA - 2SMA. Now it’s my time to do smth alike aye?
...
This script is remake of my 1st degree WLSMA via linear filter combo. It’s much faster, we aint calculate moving regression per se, we just match its freq response. You can see it on the screen (WLSMAfa) almost perfectly matching the original one (WLSMA).
...
While humans like to overfit, I fw generalizations. So your lovely WMA is actually just one case of a more general weight pattern: pow(len - i, e), where pow is the power function and e is the exponent itself. So:
- If e = 0, then we have SMA (every number in 0th power is one)
- If e = 1, we get WMA
- If e = 2, we get quadratic weights.
We can recreate WLSMA freq response then by combining 2 filters with e = 1 and e = 2.
This is still an approximation, even tho enormously precise for the tasks you’ve shared with me. Due to the non-linear nature of the thing it’s all we can do, and as window size grows, even this small discrepancy converges with true WLSMA value, so we’re all good. Pls don’t try to model this 0.00xxxx discrepancy, it’s not natural.
...
DSP approach is unnatural for prices, but you can put this thing on volume delta and be happy, or on other metrics of yours, if for some reason u dont wanna estimate thresholds by fitting a distro.
All good TV
∞
P.S.: strangely, the first script made & dropped in the location in Saint P where my actual quant way has started ~5 years ago xD, very thankful
RSI Overbought/Oversold Signals with 200 EMA FilterLong signals (RSI < 25) should only trigger if the price is above the 200 EMA (indicating a bullish long-term trend).
Short signals (RSI > 75) should only trigger if the price is below the 200 EMA (indicating a bearish long-term trend).
Advanced Petroleum Market Model (APMM)Advanced Petroleum Market Model (APMM): A Multi-Factor Fundamental Analysis Framework for Oil Market Assessment
## 1. Introduction
The petroleum market represents one of the most complex and globally significant commodity markets, characterized by intricate supply-demand dynamics, geopolitical influences, and substantial price volatility (Hamilton, 2009). Traditional fundamental analysis approaches often struggle to synthesize the multitude of relevant indicators into actionable insights due to data heterogeneity, temporal misalignment, and subjective weighting schemes (Baumeister & Kilian, 2016).
The Advanced Petroleum Market Model addresses these limitations through a systematic, quantitative approach that integrates 16 verified fundamental indicators across five critical market dimensions. The model builds upon established financial engineering principles while incorporating petroleum-specific market dynamics and adaptive learning mechanisms.
## 2. Theoretical Framework
### 2.1 Market Efficiency and Information Integration
The model operates under the assumption of semi-strong market efficiency, where fundamental information is gradually incorporated into prices with varying degrees of lag (Fama, 1970). The petroleum market's unique characteristics, including storage costs, transportation constraints, and geopolitical risk premiums, create opportunities for fundamental analysis to provide predictive value (Kilian, 2009).
### 2.2 Multi-Factor Asset Pricing Theory
Drawing from Ross's (1976) Arbitrage Pricing Theory, the model treats petroleum prices as driven by multiple systematic risk factors. The five-factor decomposition (Supply, Inventory, Demand, Trade, Sentiment) represents economically meaningful sources of systematic risk in petroleum markets (Chen et al., 1986).
## 3. Methodology
### 3.1 Data Sources and Quality Framework
The model integrates 16 fundamental indicators sourced from verified TradingView economic data feeds:
Supply Indicators:
- US Oil Production (ECONOMICS:USCOP)
- US Oil Rigs Count (ECONOMICS:USCOR)
- API Crude Runs (ECONOMICS:USACR)
Inventory Indicators:
- US Crude Stock Changes (ECONOMICS:USCOSC)
- Cushing Stocks (ECONOMICS:USCCOS)
- API Crude Stocks (ECONOMICS:USCSC)
- API Gasoline Stocks (ECONOMICS:USGS)
- API Distillate Stocks (ECONOMICS:USDS)
Demand Indicators:
- Refinery Crude Runs (ECONOMICS:USRCR)
- Gasoline Production (ECONOMICS:USGPRO)
- Distillate Production (ECONOMICS:USDFP)
- Industrial Production Index (FRED:INDPRO)
Trade Indicators:
- US Crude Imports (ECONOMICS:USCOI)
- US Oil Exports (ECONOMICS:USOE)
- API Crude Imports (ECONOMICS:USCI)
- Dollar Index (TVC:DXY)
Sentiment Indicators:
- Oil Volatility Index (CBOE:OVX)
### 3.2 Data Quality Monitoring System
Following best practices in quantitative finance (Lopez de Prado, 2018), the model implements comprehensive data quality monitoring:
Data Quality Score = Σ(Individual Indicator Validity) / Total Indicators
Where validity is determined by:
- Non-null data availability
- Positive value validation
- Temporal consistency checks
### 3.3 Statistical Normalization Framework
#### 3.3.1 Z-Score Normalization
The model employs robust Z-score normalization as established by Sharpe (1994) for cross-indicator comparability:
Z_i,t = (X_i,t - μ_i) / σ_i
Where:
- X_i,t = Raw value of indicator i at time t
- μ_i = Sample mean of indicator i
- σ_i = Sample standard deviation of indicator i
Z-scores are capped at ±3 to mitigate outlier influence (Tukey, 1977).
#### 3.3.2 Percentile Rank Transformation
For intuitive interpretation, Z-scores are converted to percentile ranks following the methodology of Conover (1999):
Percentile_Rank = (Number of values < current_value) / Total_observations × 100
### 3.4 Exponential Smoothing Framework
Signal smoothing employs exponential weighted moving averages (Brown, 1963) with adaptive alpha parameter:
S_t = α × X_t + (1-α) × S_{t-1}
Where α = 2/(N+1) and N represents the smoothing period.
### 3.5 Dynamic Threshold Optimization
The model implements adaptive thresholds using Bollinger Band methodology (Bollinger, 1992):
Dynamic_Threshold = μ ± (k × σ)
Where k is the threshold multiplier adjusted for market volatility regime.
### 3.6 Composite Score Calculation
The fundamental score integrates component scores through weighted averaging:
Fundamental_Score = Σ(w_i × Score_i × Quality_i)
Where:
- w_i = Normalized component weight
- Score_i = Component fundamental score
- Quality_i = Data quality adjustment factor
## 4. Implementation Architecture
### 4.1 Adaptive Parameter Framework
The model incorporates regime-specific adjustments based on market volatility:
Volatility_Regime = σ_price / μ_price × 100
High volatility regimes (>25%) trigger enhanced weighting for inventory and sentiment components, reflecting increased market sensitivity to supply disruptions and psychological factors.
### 4.2 Data Synchronization Protocol
Given varying publication frequencies (daily, weekly, monthly), the model employs forward-fill synchronization to maintain temporal alignment across all indicators.
### 4.3 Quality-Adjusted Scoring
Component scores are adjusted for data quality to prevent degraded inputs from contaminating the composite signal:
Adjusted_Score = Raw_Score × Quality_Factor + 50 × (1 - Quality_Factor)
This formulation ensures that poor-quality data reverts toward neutral (50) rather than contributing noise.
## 5. Usage Guidelines and Best Practices
### 5.1 Configuration Recommendations
For Short-term Analysis (1-4 weeks):
- Lookback Period: 26 weeks
- Smoothing Length: 3-5 periods
- Confidence Period: 13 weeks
- Increase inventory and sentiment weights
For Medium-term Analysis (1-3 months):
- Lookback Period: 52 weeks
- Smoothing Length: 5-8 periods
- Confidence Period: 26 weeks
- Balanced component weights
For Long-term Analysis (3+ months):
- Lookback Period: 104 weeks
- Smoothing Length: 8-12 periods
- Confidence Period: 52 weeks
- Increase supply and demand weights
### 5.2 Signal Interpretation Framework
Bullish Signals (Score > 70):
- Fundamental conditions favor price appreciation
- Consider long positions or reduced short exposure
- Monitor for trend confirmation across multiple timeframes
Bearish Signals (Score < 30):
- Fundamental conditions suggest price weakness
- Consider short positions or reduced long exposure
- Evaluate downside protection strategies
Neutral Range (30-70):
- Mixed fundamental environment
- Favor range-bound or volatility strategies
- Wait for clearer directional signals
### 5.3 Risk Management Considerations
1. Data Quality Monitoring: Continuously monitor the data quality dashboard. Scores below 75% warrant increased caution.
2. Regime Awareness: Adjust position sizing based on volatility regime indicators. High volatility periods require reduced exposure.
3. Correlation Analysis: Monitor correlation with crude oil prices to validate model effectiveness.
4. Fundamental-Technical Divergence: Pay attention when fundamental signals diverge from technical indicators, as this may signal regime changes.
### 5.4 Alert System Optimization
Configure alerts conservatively to avoid false signals:
- Set alert threshold at 75+ for high-confidence signals
- Enable data quality warnings to maintain system integrity
- Use trend reversal alerts for early regime change detection
## 6. Model Validation and Performance Metrics
### 6.1 Statistical Validation
The model's statistical robustness is ensured through:
- Out-of-sample testing protocols
- Rolling window validation
- Bootstrap confidence intervals
- Regime-specific performance analysis
### 6.2 Economic Validation
Fundamental accuracy is validated against:
- Energy Information Administration (EIA) official reports
- International Energy Agency (IEA) market assessments
- Commercial inventory data verification
## 7. Limitations and Considerations
### 7.1 Model Limitations
1. Data Dependency: Model performance is contingent on data availability and quality from external sources.
2. US Market Focus: Primary data sources are US-centric, potentially limiting global applicability.
3. Lag Effects: Some fundamental indicators exhibit publication lags that may delay signal generation.
4. Regime Shifts: Structural market changes may require model recalibration.
### 7.2 Market Environment Considerations
The model is optimized for normal market conditions. During extreme events (e.g., geopolitical crises, pandemics), additional qualitative factors should be considered alongside quantitative signals.
## References
Baumeister, C., & Kilian, L. (2016). Forty years of oil price fluctuations: Why the price of oil may still surprise us. *Journal of Economic Perspectives*, 30(1), 139-160.
Bollinger, J. (1992). *Bollinger on Bollinger Bands*. McGraw-Hill.
Brown, R. G. (1963). *Smoothing, Forecasting and Prediction of Discrete Time Series*. Prentice-Hall.
Chen, N. F., Roll, R., & Ross, S. A. (1986). Economic forces and the stock market. *Journal of Business*, 59(3), 383-403.
Conover, W. J. (1999). *Practical Nonparametric Statistics* (3rd ed.). John Wiley & Sons.
Fama, E. F. (1970). Efficient capital markets: A review of theory and empirical work. *Journal of Finance*, 25(2), 383-417.
Hamilton, J. D. (2009). Understanding crude oil prices. *Energy Journal*, 30(2), 179-206.
Kilian, L. (2009). Not all oil price shocks are alike: Disentangling demand and supply shocks in the crude oil market. *American Economic Review*, 99(3), 1053-1069.
Lopez de Prado, M. (2018). *Advances in Financial Machine Learning*. John Wiley & Sons.
Ross, S. A. (1976). The arbitrage theory of capital asset pricing. *Journal of Economic Theory*, 13(3), 341-360.
Sharpe, W. F. (1994). The Sharpe ratio. *Journal of Portfolio Management*, 21(1), 49-58.
Tukey, J. W. (1977). *Exploratory Data Analysis*. Addison-Wesley.
FVG MTF + 50%
// FVG MTF + 50%: A Multi-Timeframe Fair Value Gap Indicator
//
// Fair Value Gaps (FVGs) are core to the Inner Circle Trader (ICT) framework and mirror institutional order‐flow imbalances.
// In trading lore, an FVG is a rapid price swing that “leaves behind a gap” – a zone without trading – which is typically revisited later.
// In technical terms, a classic FVG spans three bars: the middle candle overshoots the prior swing without overlap (e.g. the 2nd candle’s high exceeds the 1st candle’s high in a bullish FVG).
// Such gaps represent transient liquidity vacuums. Bouchaud et al. (2011) model exactly this phenomenon: aggressive order flow creates a V-shaped supply/demand profile that “vanishes around the current price.”
// In other words, an FVG is a local imbalance where liquidity was exhausted and will tend to attract mean‐reverting orders as the market seeks equilibrium.
//
// In practice, ICT emphasizes the 50% retracement of an FVG as a high-probability entry level. This midpoint can be interpreted formally via market microstructure theory:
// Hasbrouck (2000) and others posit an underlying efficient price – a latent martingale value – around which observed prices fluctuate.
// The center of a recent gap heuristically proxies that latent fair value. Indeed, empirical models of order‐flow impact predict precisely this behavior:
// Bouchaud (2010) describes a “stimulated refill” mechanism, whereby a one‐sided price surge triggers an opposing flow of limit orders that pushes price back (a rising wall of liquidity).
// This liquidity‐induced mean‐reversion ensures that price often retraces to the gap midpoint as new limit orders fill the void.
// In essence, the 50% level embodies the short‐term equilibrium to which price gravitates after a liquidity shock.
//
// The FVG MTF + 50% indicator systematically implements these insights across multiple scales (M15, H1, H4).
// It identifies FVGs on each timeframe and continuously flags mitigation when price re‐enters a gap, effectively measuring market resiliency.
// A real‐time dashboard summarizes the total count of open FVGs and how many have been filled, quantifying latent imbalances much like institutional flow statistics.
// For example, a concentration of unfilled FVGs signals that many liquidity gaps remain, suggesting pent‐up supply/demand pressures. Conversely, a high fill rate indicates rapid liquidity absorption.
// By codifying ICT rules into quantitative outputs, this tool yields an empirical gauge of market stress and mean‐reversion potential.
//
// Overall, the script bridges ICT trading concepts with formal market microstructure.
// It treats FVG gaps as spontaneous liquidity voids and the 50% midpoint as a transient efficient price, consistent with Hasbrouck’s (2000) martingale view.
// As Bouchaud et al. note, markets operate with vanishing immediate liquidity and without instant equilibrium, explaining why price tends to return to the gap center.
// The dashboard and alerts translate these academic principles into actionable signals: by tracking gap creation and resolution, traders gain a systematic view of hidden order-flow dynamics.
// In summary, “FVG MTF + 50%” casts ICT’s smart‐money ideas in a rigorous framework (citing O’Hara, Hasbrouck, Bouchaud, Farmer, etc.), providing a scientific tool that enhances decision‐making with precise liquidity‐based metrics.
//
// References (illustrative):
// • Hasbrouck, J. (2000). The Economics of Microstructure: Latent Efficient Prices and Observed Quotes. wpa00047.pdf.
// • O’Hara, M. (1995). Market Microstructure Theory.
// • Bouchaud, J.-P., Farmer, J. D., & Lillo, F. (2011). How Markets Slowly Digest Changes in Supply and Demand. arXiv:1105.1694.
// • Bouchaud, J.-P. (2010). The Endogenous Dynamics of Markets: Price Impact and Feedback Loops. Farm\_CFM\_269-2010.pdf.
// • Huddleston, I. C. T. (ICT). Inner Circle Trader Lectures on Fair Value Gaps and 50% Midpoints.
//
// URLs for further reading:
// • (atas.net)
// • (fxopen.com)
// • (arxiv.org)
// • (w4.stern.nyu.edu)
// • (www.cfm.com)
//
// =============================================================================
//
// This indicator identifies Fair Value Gaps (FVGs) on M15, H1, and H4 timeframes, highlights them on the chart as colored boxes, draws the 50% median line,
// and displays price labels for the 0%, 50%, and 100% levels of each gap.
// It also tracks when gaps are “filled” (mitigated) and logs counts on a dashboard, providing real-time metrics on open/filled FVGs for liquidity analysis.
//
// Key Features:
// 1. Multi‐Timeframe Detection: Scans M15, H1, H4 for three‐bar FVG patterns using a configurable threshold.
// 2. Colored Zones and Median Lines: Draws bullish (green) and bearish (red) gap boxes, bordered in white, with a dashed white line at the midpoint.
// 3. Price Labels: Optionally annotates each gap with “0% FVG = \$X,” “50% FVG = \$Y,” and “100% FVG = \$Z” at the moment of detection.
// 4. Gap Mitigation: Monitors price re‐entry into a gap; when filled, it removes the box and logs a dashed line at the fill price.
// 5. Dashboard: Counts total bullish/bearish FVGs and calculates the percentage filled on each timeframe.
// 6. Alerts: Configurable alerts for new gap creation and fill events at 0%, 50%, and 100% levels.
//
// Implementation Details:
// • Detection Logic: A three-bar gap occurs when the middle bar’s low is above the prior bar’s high (bullish) or its high is below the prior bar’s low (bearish).
// A “threshold” parameter filters minor gaps based on relative size.
// • Data Structures: Uses Pine v6’s user‐defined “fvg” type to store gap high, low, direction, and timestamp. Arrays track open boxes, lines, labels for each timeframe.
// • Drawing:
// – box.new() draws transparent rectangles spanning 500 bars into the future.
// – line.new() draws dashed median lines and mitigation lines when gaps are filled.
// – label.new() places price annotations at the current right edge with textalign=text.align\_right.
// • Dashboard: table.new() creates a 3×3 panel showing “Bullish”/“Bearish” counts and “Mitigated” percentages in real time.
// • Alerts: alertcondition() triggers when new gaps form or are mitigated at specified percentages.
//
// Usage:
// • Add to chart: Apply the script; enable or disable timeframes via checkboxes (Enable FVG M15, H1, H4).
// • Configure text labels: Toggle “Text” to show or hide on‐chart price annotations.
// • Monitor dashboard: Observe counts and fill rates to gauge market liquidity pressure.
// • Set alerts: Enable alerts for specific levels (0%, 50%, 100%) and timeframes as needed.
//
// Potential Extensions:
// • Customizable lookback on fill monitoring (beyond “showLast” parameter).
// • Dynamic threshold based on ATR or volatility metrics instead of static percentage.
// • Integration with order‐flow or volume data to refine gap significance.
// • Expanded timeframes (D1, W, etc.) for higher‐timeframe liquidity profiling.
//
// =============================================================================
//
// © 2025. Licensed under CC BY‐NC‐SA 4.0 International.
// Feel free to reference academic works (Hasbrouck, Bouchaud, O’Hara) for theoretical context.
//
// End of Description.
HA Signal + Universal + Fixed Single Confirmationplaying around with EMA and DOJI signals. getting a lot of false signals if anyone has an idea
Risk Criteria Score Histogram It shows a daily score (0 to 3) representing the number of risk-off criteria currently triggered—helping visually track market environment changes.
Remember the 3 risk Criteria:
Short-Term Trend — Price relative to the 20-day exponential moving average (S&P 500)
Breadth — Net new highs vs. new lows across NYSE and Nasdaq
Momentum — Percentage Price Oscillator (PPO) on the S&P 500
This is based on Tom the Trader signals