//@version=6
indicator("Fair Value Gaps (FVG)", overlay=true)
// Function to detect bullish and bearish FVGs
is_bullish_fvg = high[1] < low
is_bearish_fvg = low[1] > high
// Draw Bullish FVG
if is_bullish_fvg
[Link](
x1=bar_index[1], x2=bar_index,
y1=high[1], y2=low,
bgcolor=[Link]([Link], 85),
border_width=0
)
// Draw Bearish FVG
if is_bearish_fvg
[Link](
x1=bar_index[1], x2=bar_index,
y1=low[1], y2=high,
bgcolor=[Link]([Link], 85),
border_width=0
)