OPEN-SOURCE SCRIPT
FVG / iFVG / BPR - Core X

# FVG / iFVG / BPR – Multi-Timeframe
**Description:**
This indicator automatically detects Fair Value Gaps (FVG), tracks their invalidation into Inverse FVGs (iFVG), and identifies Balanced Price Range (BPR) zones — all simultaneously across up to 5 independent timeframes (defaults: chart, 5m, 15m, 4H, D).
**What the script does**
A Fair Value Gap is a price imbalance formed by three consecutive candles — a gap between the high of the first candle and the low of the third (bullish), or the reverse (bearish). The script draws it as a box that keeps extending to the right until price touches a chosen mitigation level (Proximal / 50% / Distal, configurable separately for FVG). If price later closes a candle beyond the opposite boundary of the zone, the FVG is invalidated and flips into an iFVG — a signal of potential continuation in the opposite direction, with its own independently configurable mitigation level.
A BPR forms where two oppositely oriented FVG zones on the same timeframe overlap, marking an area of balance between supply and demand.
**How to read the zones**
Color indicates direction (green = bullish, red = bearish); violet is reserved exclusively for BPR zones. A slate-gray color means the zone has already reached its mitigation level. The label next to each zone also carries a marker: ✓ means the zone reached its target, ✗ means the original FVG was invalidated and flipped into an iFVG. Once a zone reaches its final mitigation level, it's automatically removed from the chart so resolved historical zones don't clutter the view.
**Settings**
Optional toggle to show only zones matching the chart's currently active timeframe, a minimum zone-size filter (in pips or ATR multiples), a validity period for zones that never get mitigated (auto-cleanup), independent mitigation levels for FVG/iFVG/BPR, and dedicated alerts for every stage (FVG formed, FVG mitigated, iFVG formed, iFVG mitigated, BPR formed, BPR touched).
**Disclaimer**
This indicator visualizes price imbalances based on ICT/Smart Money concepts and is intended for analytical and educational purposes only. It does not constitute financial advice or a trading signal — all trading decisions and associated risks remain solely with the user.
**Description:**
This indicator automatically detects Fair Value Gaps (FVG), tracks their invalidation into Inverse FVGs (iFVG), and identifies Balanced Price Range (BPR) zones — all simultaneously across up to 5 independent timeframes (defaults: chart, 5m, 15m, 4H, D).
**What the script does**
A Fair Value Gap is a price imbalance formed by three consecutive candles — a gap between the high of the first candle and the low of the third (bullish), or the reverse (bearish). The script draws it as a box that keeps extending to the right until price touches a chosen mitigation level (Proximal / 50% / Distal, configurable separately for FVG). If price later closes a candle beyond the opposite boundary of the zone, the FVG is invalidated and flips into an iFVG — a signal of potential continuation in the opposite direction, with its own independently configurable mitigation level.
A BPR forms where two oppositely oriented FVG zones on the same timeframe overlap, marking an area of balance between supply and demand.
**How to read the zones**
Color indicates direction (green = bullish, red = bearish); violet is reserved exclusively for BPR zones. A slate-gray color means the zone has already reached its mitigation level. The label next to each zone also carries a marker: ✓ means the zone reached its target, ✗ means the original FVG was invalidated and flipped into an iFVG. Once a zone reaches its final mitigation level, it's automatically removed from the chart so resolved historical zones don't clutter the view.
**Settings**
Optional toggle to show only zones matching the chart's currently active timeframe, a minimum zone-size filter (in pips or ATR multiples), a validity period for zones that never get mitigated (auto-cleanup), independent mitigation levels for FVG/iFVG/BPR, and dedicated alerts for every stage (FVG formed, FVG mitigated, iFVG formed, iFVG mitigated, BPR formed, BPR touched).
**Disclaimer**
This indicator visualizes price imbalances based on ICT/Smart Money concepts and is intended for analytical and educational purposes only. It does not constitute financial advice or a trading signal — all trading decisions and associated risks remain solely with the user.
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.
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.
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.