PROTECTED SOURCE SCRIPT
已更新 Fair Value Gaps (FVG)

Overview:
This indicator detects Fair Value Gaps (FVGs) – also known as Liquidity Voids – which are three-candle price inefficiencies formed when the market aggressively moves in one direction, leaving an imbalance between buyers and sellers. These zones often act as magnetic areas where prices return to "fill the gap" before continuing their trend.
🔍 Core Logic:
A bullish FVG is identified when the high of candle 1 (two bars back) is below the low of candle 3 (current bar).
A bearish FVG is identified when the low of candle 1 (two bars back) is above the high of candle 3 (current bar).
A minimum gap size is required (defined in points or as a multiple of ATR).
Each detected FVG is drawn as a rectangle, extending forward in time until mitigation.
🛠️ Key Features:
✅ Bullish & Bearish Detection: Option to show/hide each type.
📏 Minimum Gap Filter: Define minimum size in absolute points or ATR-based.
📈 Trend Filter: Enable EMA-based directional filtering to align FVGs with the trend.
🧠 Mitigation Logic: Supports four modes:
None: Gaps remain visible regardless of price action.
Partial: Mitigated when the price trades within the gap.
Full: Mitigated only when the price fills the gap.
Midpoint: Mitigated once the midpoint of the gap is touched.
⏳ Lookback Control: Automatically removes old FVGs after a configurable number of bars.
🎯 Use Cases:
Entry confirmation: Price returning to an FVG in line with the higher-timeframe trend may signal a high-probability trade.
Liquidity mapping: Helps identify where institutional orders may be filled.
Confluence zones: Combine with market structure (BOS/CHOCH) or order blocks for refined entries.
📊 Customization:
Fully adjustable visuals (color, opacity) for both active and mitigated zones.
User-defined settings to fit different instruments, timeframes, or strategies.
🧠 Best Practices:
Use FVGs on 15m–1h charts with trend confirmation from higher timeframes (e.g., 4H or Daily).
Combine with market structure shifts, momentum indicators, or volume spikes for better decision-making.
In volatile markets, consider increasing the minimum gap size or ATR multiplier.
⚠️ Disclaimer:
This tool is intended for educational and analytical purposes only. It does not constitute financial advice. Always backtest and validate before trading live.
This indicator detects Fair Value Gaps (FVGs) – also known as Liquidity Voids – which are three-candle price inefficiencies formed when the market aggressively moves in one direction, leaving an imbalance between buyers and sellers. These zones often act as magnetic areas where prices return to "fill the gap" before continuing their trend.
🔍 Core Logic:
A bullish FVG is identified when the high of candle 1 (two bars back) is below the low of candle 3 (current bar).
A bearish FVG is identified when the low of candle 1 (two bars back) is above the high of candle 3 (current bar).
A minimum gap size is required (defined in points or as a multiple of ATR).
Each detected FVG is drawn as a rectangle, extending forward in time until mitigation.
🛠️ Key Features:
✅ Bullish & Bearish Detection: Option to show/hide each type.
📏 Minimum Gap Filter: Define minimum size in absolute points or ATR-based.
📈 Trend Filter: Enable EMA-based directional filtering to align FVGs with the trend.
🧠 Mitigation Logic: Supports four modes:
None: Gaps remain visible regardless of price action.
Partial: Mitigated when the price trades within the gap.
Full: Mitigated only when the price fills the gap.
Midpoint: Mitigated once the midpoint of the gap is touched.
⏳ Lookback Control: Automatically removes old FVGs after a configurable number of bars.
🎯 Use Cases:
Entry confirmation: Price returning to an FVG in line with the higher-timeframe trend may signal a high-probability trade.
Liquidity mapping: Helps identify where institutional orders may be filled.
Confluence zones: Combine with market structure (BOS/CHOCH) or order blocks for refined entries.
📊 Customization:
Fully adjustable visuals (color, opacity) for both active and mitigated zones.
User-defined settings to fit different instruments, timeframes, or strategies.
🧠 Best Practices:
Use FVGs on 15m–1h charts with trend confirmation from higher timeframes (e.g., 4H or Daily).
Combine with market structure shifts, momentum indicators, or volume spikes for better decision-making.
In volatile markets, consider increasing the minimum gap size or ATR multiplier.
⚠️ Disclaimer:
This tool is intended for educational and analytical purposes only. It does not constitute financial advice. Always backtest and validate before trading live.
發行說明
This version brings a powerful upgrade to help traders identify and react to institutional imbalances more effectively:✅ 1. Live Extension of Gaps
All detected Fair Value Gaps now automatically extend forward on the chart in real-time until they are fully or partially filled. This allows you to easily track unmitigated liquidity zones as price develops.
✅ 2. Smarter Mitigation Tracking
You can now control how the indicator marks a gap as “mitigated” using 4 intuitive options:
None: Gaps stay active until removed
Partial: Price touches the gap area
Full: Price completely fills the gap
Midpoint: Price reaches the midpoint of the gap
Once mitigated, the gap changes color, so you can quickly distinguish between active and resolved zones.
✅ 3. Noise-Free Display with Lookback Control
Old or irrelevant gaps are automatically removed after a customizable period (default 200 candles), keeping your chart clean and focused.
✅ 4. Supports Volatility-Based Filtering
You can now filter out small or weak gaps by setting a minimum gap size:
Use a fixed number of points, or
Base it on ATR (Average True Range) to adjust for market volatility.
This ensures that only meaningful gaps are highlighted—ideal for intraday and swing traders.
✅ 5. Trend Filter Option
You can choose to display only FVGs in the direction of the trend, based on a customizable EMA filter. This helps you focus on high-probability setups aligned with market momentum.
✅ 6. Cleaner Visualization
Bullish and bearish gaps use clear color codes:
Green zones for bullish FVGs
Red zones for bearish FVGs
Faded colors for mitigated areas
This makes it visually easy to see which gaps are still active and which ones are already played out.
Whether you're trading Smart Money Concepts, institutional liquidity, or simply looking to add an objective imbalance detector to your setup, this tool is built to support precise decision-making.
✅ Compatible with scalping, day trading, and swing strategies
🕒 Optimized for 15min and 1H charts
🔄 Lightweight performance for smooth charting
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。