Skip to content

Fair Value Gap

Structure · Smart Money

Fair Value Gap node on the canvas

Three-candle price imbalances (bullish / bearish FVGs), tagged with filled-vs-open state and age. Filter to open-only for the canonical SMC entry workflow.

A Fair Value Gap (FVG) is a price imbalance — a window where the market moved so fast it left a gap that no trading happened in. Smart-money traders treat these gaps as magnets: price often returns to "fill" the inefficiency before continuing. This block scans your bars, detects every bullish and bearish FVG, and hands you the zones already tagged with whether they're still open (un-filled, actionable) or spent — so you can build entries around the moments price comes back to rebalance.

How it works

It uses the classic three-candle definition. Walking each bar i (with a neighbour on each side):

  • Bullish FVG: the prior candle's high sits below the next candle's low — high[i-1] < low[i+1]. That untouched space from high[i-1] up to low[i+1] is the gap.
  • Bearish FVG: the prior candle's low sits above the next candle's high — low[i-1] > high[i+1].

Each detected zone is then checked for fill. A bullish gap counts as filled the first later bar whose low drops back to the gap's bottom; a bearish gap fills when a later bar's high pushes up to the gap's top. Only a full fill (reaching the far side) counts — partial mitigation doesn't mark it spent. Every zone carries status ('open'/'filled'), age_bars (distance from the latest bar), and an end_time that runs to the fill bar or, if still open, the final bar. Use Detect bullish FVGs / Detect bearish FVGs to pick direction, Only show open FVGs (on by default — the canonical SMC view) to hide spent gaps, and Max age (bars, 0=off) to drop ancient imbalances.

When to use it

Reach for it when you trade pullbacks into imbalance — price runs hard, leaves a gap, and you want to enter on the retrace into it with the trend. It pairs naturally with a higher-timeframe bias filter so you only take FVGs in the direction of structure. It's not a standalone signal: in choppy, rangebound markets gaps form and fill constantly with no follow-through, so don't fire blind entries off raw detections.

Example

Bias filter → FVG entry. Wire Bars into Fair Value Gap with Only show open FVGs on. Add a MarketStructure or higher-timeframe EMA block to define trend, and only act on bullish FVGs when structure is bullish. Feed an entry condition that triggers when price re-enters an open zone into a Signal, then size and protect it with a StopLoss placed just past the far side of the gap. Route the zones into the Chart/Tester to see and backtest the boxes.

Tips & gotchas

  • No lookahead in live logic — detection needs the bar after the gap, so a fresh FVG only confirms one bar later. Don't build a strategy that assumes you entered on the gap-forming candle itself.
  • Fill ≠ mitigation. This block only marks a gap filled when price reaches the far side. A wick that dips in but doesn't cross still reads as 'open', which matches most SMC playbooks but may differ from tools that use 50%-mitigation.
  • Open-only is usually what you want. Leaving Only show open FVGs on keeps your graph focused on actionable zones; turn it off only for research or to visualise how reliably gaps fill.
  • Tune Max age. On low timeframes thousands of stale gaps pile up. Set Max age (bars) to keep only recent, tradeable imbalances and avoid acting on year-old noise.
  • Confirm, don't predict. FVGs are a where, not a when — always combine with structure, a level, or momentum confirmation before entering.

Inputs

Socket Type What to wire in
Bars bars Price bars

Outputs

Output Type Plots as Description
FVGs zones Zone boxes List of FVG zones with status ('open' | 'filled'), age_bars, and end_time (when filled, else final bar).

Parameters

Parameter Type Default What it does
Detect bullish FVGs on / off True
Detect bearish FVGs on / off True
Only show open FVGs on / off True On: hide FVGs that price has fully filled (the canonical SMC view). Off: show all detected FVGs including spent ones.
Max age (bars, 0=off) number · 0–100000 0 Hide FVGs older than this many bars from the latest bar.

Reference auto-generated from the block catalog · category Structure.