OPEN-SOURCE SCRIPT
FVG Scanner Pro

FVG Scanner Pro — Smart Fair Value Gap Detector (with HTF context & proximity alerts)
What it does
FVG Scanner Pro automatically finds Fair Value Gaps (FVGs) on your current chart and (optionally) on a higher timeframe (HTF), draws them as color-coded zones, and notifies you when price comes close to a gap boundary using an ADR-based proximity trigger and (optional) volume confirmation. It’s designed for ICT-style gap trading, confluence building, and clean visual execution.
How it works:
FVG definition
* Bullish FVG (gap up): low > high[2] (the current candle’s low is above the high 2 bars ago).
* Bearish FVG (gap down): high < low[2] (the current candle’s high is below the low 2 bars ago).
* Gaps smaller than your Min FVG Size (%) are ignored. (Gap size = (top-bottom)/bottom * 100.)
Higher-timeframe logic (auto-selected)
The script auto picks a sensible HTF:
1–5m → 15m, 15m → 1H, 1H → 4H, 4H → 1D, 1D → 1W, 1W → 1M, small 1M → 3M, big ≥3M → 12M.
You can display HTF FVGs and even filter so current-TF FVGs only show when they overlap an HTF gap.
Proximity alerts (ADR-based)
The script computes ADR on the current chart timeframe over a user-set lookback (default 20 bars).
An alert fires when price moves toward the closest actionable boundary and comes within ADR × Multiplier:
Bullish: price moving down, within distance of the bottom of a bullish FVG.
Bearish: price moving up, within distance of the top of a bearish FVG.
Yellow ▲/▼ markers show where a proximity alert triggered.
Volume filter (optional)
Require volume to be greater than SMA(20) × multiplier to accept a newly formed FVG.
Lifecycle
Each gap remains active for Extend FVG Box (Bars) bars.
You can delete the box after fill, or keep filled gaps visible as gray zones, or hide them.
Color legend
Current-TF Bullish: Pink/Magenta box
Current-TF Bearish: Cyan/Turquoise box
HTF Bullish: Gold box
HTF Bearish: Orange box
Filled (if shown): Gray box
Alert markers: Yellow ▲ (bullish), Yellow ▼ (bearish)
Inputs (what to tweak)
Show FVGs: Bullish / Bearish / Both
Max Bars Back to Find FVG: collection window & cleanup guard
Extend FVG Box (Bars): how long a zone stays tradable/active
Min FVG Size (%): ignore micro gaps
Delete Box After Fill & Show Filled FVGs: choose how you want completed gaps handled
Show Alert Markers: show/hide the yellow proximity arrows
Show Higher Timeframe FVG: overlay HTF gaps (auto TF)
HTF Filter: only display current-TF gaps that overlap an HTF gap
ADR Lookback & Proximity Multiplier: tune alert sensitivity to your market & timeframe
Volume Filter & Volume > MA Multiple: require above-average volume for new gaps
Built-in alerts (ready to use)
Create alerts in TradingView (⚠️ “Once per bar” or “Once per bar close”, your choice) and select from:
🟢 Bullish FVG Proximity — price approaching a bullish gap bottom
🔴 Bearish FVG Proximity — price approaching a bearish gap top
✅ New Bullish FVG Formed
⚠️ New Bearish FVG Formed
The alert messages include the symbol and price; proximity markers are also plotted on chart.
Tips & best practices
Use FVGs with market structure (break of structure, swing points), order blocks, or liquidity pools for confluence.
On very low timeframes, raise Min FVG Size and/or lower Max Bars Back to reduce noise and keep things fast.
Extend FVG Box controls how long a zone is considered valid; align it with your holding horizon (scalp vs swing).
Information panel (top-right)
Shows your mode, current HTF, number of gaps in memory, active bull/bear counts, and current-TF ADR.
What it does
FVG Scanner Pro automatically finds Fair Value Gaps (FVGs) on your current chart and (optionally) on a higher timeframe (HTF), draws them as color-coded zones, and notifies you when price comes close to a gap boundary using an ADR-based proximity trigger and (optional) volume confirmation. It’s designed for ICT-style gap trading, confluence building, and clean visual execution.
How it works:
FVG definition
* Bullish FVG (gap up): low > high[2] (the current candle’s low is above the high 2 bars ago).
* Bearish FVG (gap down): high < low[2] (the current candle’s high is below the low 2 bars ago).
* Gaps smaller than your Min FVG Size (%) are ignored. (Gap size = (top-bottom)/bottom * 100.)
Higher-timeframe logic (auto-selected)
The script auto picks a sensible HTF:
1–5m → 15m, 15m → 1H, 1H → 4H, 4H → 1D, 1D → 1W, 1W → 1M, small 1M → 3M, big ≥3M → 12M.
You can display HTF FVGs and even filter so current-TF FVGs only show when they overlap an HTF gap.
Proximity alerts (ADR-based)
The script computes ADR on the current chart timeframe over a user-set lookback (default 20 bars).
An alert fires when price moves toward the closest actionable boundary and comes within ADR × Multiplier:
Bullish: price moving down, within distance of the bottom of a bullish FVG.
Bearish: price moving up, within distance of the top of a bearish FVG.
Yellow ▲/▼ markers show where a proximity alert triggered.
Volume filter (optional)
Require volume to be greater than SMA(20) × multiplier to accept a newly formed FVG.
Lifecycle
Each gap remains active for Extend FVG Box (Bars) bars.
You can delete the box after fill, or keep filled gaps visible as gray zones, or hide them.
Color legend
Current-TF Bullish: Pink/Magenta box
Current-TF Bearish: Cyan/Turquoise box
HTF Bullish: Gold box
HTF Bearish: Orange box
Filled (if shown): Gray box
Alert markers: Yellow ▲ (bullish), Yellow ▼ (bearish)
Inputs (what to tweak)
Show FVGs: Bullish / Bearish / Both
Max Bars Back to Find FVG: collection window & cleanup guard
Extend FVG Box (Bars): how long a zone stays tradable/active
Min FVG Size (%): ignore micro gaps
Delete Box After Fill & Show Filled FVGs: choose how you want completed gaps handled
Show Alert Markers: show/hide the yellow proximity arrows
Show Higher Timeframe FVG: overlay HTF gaps (auto TF)
HTF Filter: only display current-TF gaps that overlap an HTF gap
ADR Lookback & Proximity Multiplier: tune alert sensitivity to your market & timeframe
Volume Filter & Volume > MA Multiple: require above-average volume for new gaps
Built-in alerts (ready to use)
Create alerts in TradingView (⚠️ “Once per bar” or “Once per bar close”, your choice) and select from:
🟢 Bullish FVG Proximity — price approaching a bullish gap bottom
🔴 Bearish FVG Proximity — price approaching a bearish gap top
✅ New Bullish FVG Formed
⚠️ New Bearish FVG Formed
The alert messages include the symbol and price; proximity markers are also plotted on chart.
Tips & best practices
Use FVGs with market structure (break of structure, swing points), order blocks, or liquidity pools for confluence.
On very low timeframes, raise Min FVG Size and/or lower Max Bars Back to reduce noise and keep things fast.
Extend FVG Box controls how long a zone is considered valid; align it with your holding horizon (scalp vs swing).
Information panel (top-right)
Shows your mode, current HTF, number of gaps in memory, active bull/bear counts, and current-TF ADR.
Скрипт с открытым кодом
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.
Скрипт с открытым кодом
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.