OPEN-SOURCE SCRIPT
FVG+OB Hunter -Free- [AlgoTrader Pro]

FVG + OB Hunter (Free) [AlgoTraderPro]
Fair Value Gaps and Order Blocks are the foundation of Smart Money Concepts trading. This free indicator detects both automatically, draws them on your chart, and tracks each zone until it is mitigated—so you always know which support and resistance zones are still live.
Core functions
How detection works
A Bearish FVG forms when the current candle's high is below the low two bars prior; a Bullish FVG when the current low is above the high two bars prior. When a gap forms, the indicator scans back up to OB Scan Lookback bars (default 10) for the last opposing candle—its body becomes the Order Block. Each zone extends right with every bar and is removed when price closes through it (invalidated) or closes beyond the far edge after entry (mitigated). Only unmitigated, live zones stay on the chart.
The Nearest-Zones table
Four rows—nearest Bear FVG and Supply OB above, nearest Bull FVG and Demand OB below—sorted by distance to price. Columns: ZONE | ENTRY | RANGE | DIST, where ENTRY is the near edge and DIST is the percent distance from the current close. Positionable in any corner.
Settings
Show Bearish FVG · Show Bullish FVG · Show Order Blocks · Show Nearest-Zones Table · zone colours · Extension Transparency (60–99) · OB Scan Lookback (3–50, how far back the opposing OB candle is sought) · Table Position. All inputs carry tooltips.
How to use it
The near edge (ENTRY) of an unmitigated zone is a support/resistance reference—for limit entries, for placing protective stops just beyond a zone, or simply to see where price is likely to react. The table keeps the nearest levels and their distances in view at all times.
Credits & compatibility
Fair Value Gaps and Order Blocks are Smart Money Concepts popularised by the ICT / SMC community. This is an original, independent PineScript v6 implementation of those concepts; no third-party code is used. Works on all assets and all timeframes and is compatible with all TradingView plans.
This is the free edition. An extended edition that additionally grades each zone (A / B / C), tags it by trend and volume, highlights the strongest confluence setups, and fires alerts is also available.
Fair Value Gaps and Order Blocks are the foundation of Smart Money Concepts trading. This free indicator detects both automatically, draws them on your chart, and tracks each zone until it is mitigated—so you always know which support and resistance zones are still live.
Core functions
- Detects Bullish and Bearish Fair Value Gaps (3-candle imbalances) and marks them as support/resistance zones
- Identifies Supply and Demand Order Blocks—the last opposing candle before a strong impulse move
- Extends each zone to the right with semi-transparent boxes and auto-deletes it when mitigated
- Live Nearest-Zones table: the closest zones above and below price, with entry, range and distance
How detection works
A Bearish FVG forms when the current candle's high is below the low two bars prior; a Bullish FVG when the current low is above the high two bars prior. When a gap forms, the indicator scans back up to OB Scan Lookback bars (default 10) for the last opposing candle—its body becomes the Order Block. Each zone extends right with every bar and is removed when price closes through it (invalidated) or closes beyond the far edge after entry (mitigated). Only unmitigated, live zones stay on the chart.
The Nearest-Zones table
Four rows—nearest Bear FVG and Supply OB above, nearest Bull FVG and Demand OB below—sorted by distance to price. Columns: ZONE | ENTRY | RANGE | DIST, where ENTRY is the near edge and DIST is the percent distance from the current close. Positionable in any corner.
Settings
Show Bearish FVG · Show Bullish FVG · Show Order Blocks · Show Nearest-Zones Table · zone colours · Extension Transparency (60–99) · OB Scan Lookback (3–50, how far back the opposing OB candle is sought) · Table Position. All inputs carry tooltips.
How to use it
The near edge (ENTRY) of an unmitigated zone is a support/resistance reference—for limit entries, for placing protective stops just beyond a zone, or simply to see where price is likely to react. The table keeps the nearest levels and their distances in view at all times.
Credits & compatibility
Fair Value Gaps and Order Blocks are Smart Money Concepts popularised by the ICT / SMC community. This is an original, independent PineScript v6 implementation of those concepts; no third-party code is used. Works on all assets and all timeframes and is compatible with all TradingView plans.
This is the free edition. An extended edition that additionally grades each zone (A / B / C), tags it by trend and volume, highlights the strongest confluence setups, and fires alerts is also available.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Code. Structure. Execution. Zones and flows from a live algorithmic trading desk. algotraderpro.io
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Code. Structure. Execution. Zones and flows from a live algorithmic trading desk. algotraderpro.io
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.