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.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน