Fair Value Gaps
Fair Value Gaps is an indicator drawn over the price chart.
statesmart money
1
indicator "Fair Value Gaps"2
pane: price3
4
input keep = 155
input min_gap = 0.56
7
state gaps: list<Zone> = []8
9
for gap in fair_value_gaps(min_size: min_gap, new_only: true):10
gaps.push(gap)11
gaps = gaps.filter(g => not g.mitigated).keep_last(keep)12
13
for g in gaps:14
box id: g.id, from: (g.formed_bar, g.top), to: (bar.index, g.bottom), color: if g.bullish then teal.fade(75) else orange.fade(75)15
label if g.bullish then "FVG +" else "FVG -", at: (g.formed_bar, g.mid), color: grayWhat this script says
Fair Value Gaps is an indicator drawn over the price chart.
You can change 2 inputs: keep (default 15) and min_gap (default 0.5).
It remembers gaps from one bar to the next.
It calculates gaps as gaps.filter(g => not g.mitigated).keep_last(keep).
On each bar, it goes through each gap in the fair value gaps and adds gap to gaps.
On each bar, it goes through each g in gaps and draws a box and labels if g.bullish then "FVG +" else "FVG -".