OPEN-SOURCE SCRIPT
CRR - Gaps + FVG PRO

Uses ATR
Calculates ATR and, with minAtrR, defines the minimum size for a GAP or FVG to be considered valid.
Detects and draws GAPs between candles
Bullish GAP: low > high[1] (upward gap).
Bearish GAP: high < low[1] (downward gap).
Draws a box between the previous and current candle.
The box can be extended to the right.
If the price fills the gap (touches it), and autoDelGap is active, the box is deleted (mitigated).
Only saves and manages the last bullish GAP and the last bearish GAP.
Detects and draws FVG (3-candle imbalance)
Bullish FVG: high[2] < low → liquidity gap below.
Bearish FVG: low[2] > high → liquidity gap above.
Draws a box for the gap between candle 2 and the current candle.
The box can be extended to the right.
When the price completely enters the zone (fills it), if autoDelFVG is active, the box is deleted (mitigated).
Only monitors the last bullish FVG and the last bearish FVG.
🧠 In simple terms:
It marks GAPs and FVG imbalance zones on the chart, extends them to the right, and automatically deletes them when the price mitigates/fills those zones.
Calculates ATR and, with minAtrR, defines the minimum size for a GAP or FVG to be considered valid.
Detects and draws GAPs between candles
Bullish GAP: low > high[1] (upward gap).
Bearish GAP: high < low[1] (downward gap).
Draws a box between the previous and current candle.
The box can be extended to the right.
If the price fills the gap (touches it), and autoDelGap is active, the box is deleted (mitigated).
Only saves and manages the last bullish GAP and the last bearish GAP.
Detects and draws FVG (3-candle imbalance)
Bullish FVG: high[2] < low → liquidity gap below.
Bearish FVG: low[2] > high → liquidity gap above.
Draws a box for the gap between candle 2 and the current candle.
The box can be extended to the right.
When the price completely enters the zone (fills it), if autoDelFVG is active, the box is deleted (mitigated).
Only monitors the last bullish FVG and the last bearish FVG.
🧠 In simple terms:
It marks GAPs and FVG imbalance zones on the chart, extends them to the right, and automatically deletes them when the price mitigates/fills those zones.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.