OPEN-SOURCE SCRIPT

Basic FVG

Updated
Basic Fair Value Gap (FVG) Indicator
The Basic Fair Value Gap (FVG) Indicator is a tool designed for traders using the TradingView platform to identify and visualize Fair Value Gaps (FVGs) on any given chart.

Key Features:

Bullish and Bearish FVG Detection: The indicator automatically detects and highlights both bullish and bearish Fair Value Gaps on the chart. Bullish gaps are highlighted in blue, while bearish gaps are marked in red, with customizable transparency for clear visibility.

Customizable Parameters:

Max Bars Back: Users can set the maximum number of bars to look back in order to find potential FVGs.

Box Length: The length of the FVG box can be adjusted to fit the user's preference, allowing for better visual management on different timeframes.

Tick Buffer for Close Validation: The indicator only considers an FVG filled if the price closes beyond the gap by a customizable tick buffer, ensuring precise gap closure recognition.
Automatic Removal of Filled Gaps: Once an FVG is filled (i.e., the price closes beyond the gap by the defined tick buffer), the corresponding FVG box is automatically removed from the chart. This keeps the chart clean and focused on active gaps.

Real-Time Updates: The indicator updates in real-time, ensuring that traders have the most current information about potential gaps in price, which could signify strong support or resistance levels.
Release Notes
Ensured that FVG boxes are drawn only after a candle has fully closed, thereby providing more accurate and stable visual feedback. Additionally, the boxes will only be removed after a confirming candle closes beyond the FVG by at least one tick, preventing premature or incorrect removals during live price action.
Release Notes
Ensured correct FVG Removal
Chart patternsfvg

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer