indicator · on price · open source
Fair Value Gap (Bearish)
Running…
Loading chart…
About
Bearish Fair Value Gap — mirror of the bullish FVG. Three-candle pattern where bar[0]'s wick sits above bar[2]'s wick with no overlap.
- Red zone = top of bar[0] high to bottom of bar[2] low.
minGapPctfilters out noise;extendBarscontrols zone lifetime.- Look for short entries on a retest into a premium zone.
Source code
//@version=5
indicator("Fair Value Gap (Bearish)", overlay=true)
minGapPct = input.float(0.1, "Min Gap %", minval=0, maxval=5, step=0.05)
extendBars = input.int(30, "Extend Bars", minval=5, maxval=200)
gapBear = high[0] < low[2]
gapPct = (low[2] - high[0]) / close * 100
gapBear := gapBear and gapPct >= minGapPct
var float fvgBearTop = na
var float fvgBearBot = na
var int fvgBearAge = 9999
if gapBear
fvgBearTop := low[2]
fvgBearBot := high[0]
fvgBearAge := 0
fvgBearAge += 1
if fvgBearAge > extendBars
fvgBearTop := na
fvgBearBot := na
p_Bear_FVG_Top = plot(fvgBearTop, "Bear FVG Top", color=color.red, style=plot.style_linebr)
p_Bear_FVG_Bot = plot(fvgBearBot, "Bear FVG Bot", color=color.red, style=plot.style_linebr)
fill(p_Bear_FVG_Top, p_Bear_FVG_Bot, color=color.new(color.red, 88))
alertcondition(gapBear, "Bearish FVG", "Bearish fair value gap printed")
No comments yet.
Sign in to comment.