OPEN-SOURCE SCRIPT
FVG (Fair Value Gaps)

The FVG (Fair Value Gaps) indicator is a sophisticated technical analysis tool designed to identify and display fair value gaps on trading charts across multiple timeframes. Fair value gaps represent price inefficiencies that occur when there's a complete separation between consecutive candles, creating an unfilled price zone. The indicator detects these gaps by analyzing three consecutive candles: it identifies bullish FVGs when a green middle candle creates a gap where the high of the left candle is below the low of the right candle, and bearish FVGs when a red middle candle creates a gap where the low of the left candle is above the high of the right candle.
The indicator offers comprehensive customization options and intelligent filtering capabilities. Users can select any higher timeframe for FVG detection while viewing on lower timeframes, choose to display only bullish or bearish gaps, and optionally filter for large candles only to focus on more significant market inefficiencies. The system includes automatic management features such as limiting the maximum number of displayed FVGs to prevent chart clutter, customizable extension lengths for forward projection, and a validation system that continuously monitors whether gaps remain unfilled or have been invalidated by subsequent price action.
Visually, the indicator represents FVGs as colored rectangular boxes with dashed border lines, using green for bullish gaps and red for bearish gaps with full transparency control. When FVGs become invalid (filled by price), they automatically change to gray coloring to indicate their status. The indicator includes real-time alert functionality that triggers when price enters or touches FVG zones, making it valuable for both manual trading decisions and automated trading strategies. Additionally, it features a built-in Telegram channel reference for community support and educational resources.
The indicator offers comprehensive customization options and intelligent filtering capabilities. Users can select any higher timeframe for FVG detection while viewing on lower timeframes, choose to display only bullish or bearish gaps, and optionally filter for large candles only to focus on more significant market inefficiencies. The system includes automatic management features such as limiting the maximum number of displayed FVGs to prevent chart clutter, customizable extension lengths for forward projection, and a validation system that continuously monitors whether gaps remain unfilled or have been invalidated by subsequent price action.
Visually, the indicator represents FVGs as colored rectangular boxes with dashed border lines, using green for bullish gaps and red for bearish gaps with full transparency control. When FVGs become invalid (filled by price), they automatically change to gray coloring to indicate their status. The indicator includes real-time alert functionality that triggers when price enters or touches FVG zones, making it valuable for both manual trading decisions and automated trading strategies. Additionally, it features a built-in Telegram channel reference for community support and educational resources.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.