FairValueGaps

forge.taclassSince Forge API 1
Signaturepython
forge.ta.FairValueGaps(**inputs: Any) -> None

Three-candle imbalances, shown until price fills them.

Inputs

NameTypeDefaultRange
min_sizefloat00 or more
auto_thresholdbooltrue
threshold_barsint1001 to 5000
threshold_multfloat20.1 to 10
extendint00 to 5000
mitigationchoicefilled

Indicator: Fair value gaps

A bullish gap forms on a bar whose low is above the high two bars earlier, when the bar between them closes above that high. The gap runs from that earlier high up to the bar's low. A bearish gap mirrors it.

A gap is kept only when its height is at least min_size. With auto_threshold on, it is also kept only when the middle candle's body is larger than threshold_mult times the average body of the threshold_bars candles before it.

A gap shows from the bar it forms on. With mitigation filled, a bullish gap is mitigated when price trades below its bottom; with touched, when price trades into it. Bearish gaps mirror it. bull_mitigated and bear_mitigated mark the bar, and the gap is removed. With extend above zero, a gap shows on the bar it forms and the extend bars after it, then is removed.

Slot 1 is the newest live gap of its side; Forge keeps the five newest per side. A missing bar starts the scan again.

The gaps are found on the bars the indicator runs on, which can be another timeframe than the chart's.