Fair Value Gap Node

The Fair Value Gap node finds the price gaps a fast move leaves between three candles, remembers each one until price fills it, and gives you its edges, midpoint, age and count.

NodeBy AlgoLiftUpdated 5 min read
On this page 8What a fair value gap isHow AlgoLift keeps trackExample: buy the return to a bullish gapSettingsOutputsUse something else whenWhen it doesn't behaveGoing further

When price moves fast enough, it leaves ranges behind where it barely traded. Plenty of traders believe price tends to come back to those gaps, and build entries, stops and targets around them. The Fair Value Gap node finds every gap as it forms, remembers it until price uses it up, and tells you where the nearest one is.

Takes
Nothing. It reads its series' candles
Gives
Whether price is inside a gap, and the nearest gap's edges, midpoint, age and count
Reach for it
Entries on a return to a gap, or stops and targets placed at one

What a fair value gap is

Look at three candles in a row. If the third candle's low is above the first candle's high, there's a band of prices in between that only the middle candle traded through. That band is a bullish fair value gap, usually the footprint of a strong rally. Flip it for a bearish gap: the third candle's high below the first candle's low.

Why care? The common reading is that the market moved through those prices too quickly to trade them fairly, so it tends to revisit them. Whether that holds for your market and timeframe is exactly the kind of thing a backtest should answer, rather than assume.

How AlgoLift keeps track

Each new gap goes into the node's memory as a zone with a top, a bottom and a midpoint. It stays there until it's mitigated, which is trading slang for used up, and you decide what that means:

MitigationA gap is used up when
Full fill (default)Price trades all the way through it
Body closeA candle's body closes beyond it (wicks don't count)
Wick touchPrice touches it at all

Three more choices shape the memory. Dynamic shrinking narrows a gap as price eats into it, so its near edge moves and its far edge holds. Merge consecutive joins gaps from back-to-back bars into one zone. And the node only remembers so many: Tracked zones caps the unused gaps kept per side (five by default, oldest dropped first), and Max age retires a gap after a number of bars.

The outputs always describe the nearest active gap on each side, so a level you wire into an order points at the gap closest to price, not one from last week.

Example: buy the return to a bullish gap

You trade ES 5m and want to buy when price pulls back into a bullish gap, but only after the rally that made the gap really went somewhere. Stop just under the gap.

Set the node to Bullish gaps only, with a Min Gap of 1.5 points so the one-tick gaps don't count. Then wire two conditions into a Logic AND: Inside Bull FVG, and a Comparison checking Max Points Away (Bull) is greater than 8, which proves price ran at least 8 points before coming back. The AND feeds a long Entry.

For the stop, measure the Bracket Order's stop from a level: wire Nearest Bull FVG Bottom into the stop's level input and set the distance to 2 points. The level is read once, when the trade fills, so the stop doesn't wander if a newer gap forms later.

Settings

Gap Type
Default Both
Both, Bullish or Bearish.
Gap unit
Default Raw points
Whether Min Gap and Max Gap are in points or a percentage of price.
Min Gap
Default 0
The smallest gap that counts. On ES, 1 to 2 points keeps out gaps smaller than your slippage.
Max Gap
Default 0 (any size)
The largest gap that counts. 0 means no limit.
Mitigation Logic
Default Full fill
What uses a gap up: Full fill, Body close or Wick touch.
Dynamic Shrinking
Default Off
Narrow a gap as price trades into it.
Merge Consecutive
Default Off
Join gaps from back-to-back bars into one zone.
Max Age
Default 0 (no limit)
Bars before an unused gap is dropped.
Tracked Zones
Default 5
How many unused gaps it remembers on each side.

Outputs

Each output comes in a bullish and a bearish version.

Inside Bull / Bear FVG
True or false
Price is trading inside an active gap.
Active Bull / Bear FVGs
Number
How many gaps are still unused.
Nearest FVG Top
Number
The top edge of the nearest gap.
Nearest FVG Bottom
Number
The bottom edge of the nearest gap.
Nearest FVG CE (50%)
Number
Its midpoint, which traders call consequent encroachment. A popular entry level.
Bars Since Nearest FVG
Number
How many bars ago the nearest gap formed.
Max Points Away
Number
The farthest price has moved away from the gap since it formed: a quick test of whether there was a real move before the return.

Use something else when

You mean the candle a move left behind
An order block is the last opposing candle before a strong move. It's a different object from a gap, with its own node.
You're trading a break of structure
The trend, the break and the levels to beat all come from one Market Structure node.
You need the gap's size as a number
There's no size output. A Bands line with the gap's top as the center and its bottom as the width gives you top minus bottom.

When it doesn't behave

It finds dozens of tiny gaps every day

With Min Gap at 0, every one-tick gap counts, and ES makes plenty. Set Min Gap to something you'd actually trade around. A gap smaller than your expected slippage is noise.

My entry fires inside the very move that made the gap

The gap forms on its third candle, which is often still part of the rally, so price can be "inside" it immediately. Require a real departure first: Bars Since Nearest FVG above 2, or Max Points Away above a threshold, as in the example.

A gap I can see on the chart isn't there

It was probably used up or forgotten. Check the mitigation rule (Wick touch retires gaps fastest), then Max Age, then Tracked Zones: once the node holds its limit, a new gap pushes out the oldest. The node's editor shows why each past gap ended.

The builder won't let me wire it into a Crossover

The FVG keeps its own memory across the engine's monthly chunks of history, so nodes that need the full history behind a value (a Crossover, Since, Capture, a State Machine) can't read it correctly, and the builder refuses rather than guess. Compare its levels with a Comparison, which is exact on every bar.

Going further

"Dipped under the gap's midpoint and closed back above it" sounds like it needs memory, but it doesn't. Read the lowest low of the last few completed bars with Price History, check it's below Nearest FVG CE, and AND that with the last close sitting above it.

Be honest with yourself about the mitigation rule. Full fill, Body close and Wick touch produce different sets of gaps, and therefore different strategies. Choose the one that matches your idea before you look at results. If you do try all three, that's an optimization, and it counts against your search budget like any other.

A target a set number of gap-widths above the top works too: measure the bracket's target from the Nearest FVG Top level in multiples, with the Bands line from above as the scale. Like the stop, it's fixed when the trade fills.

Or ask the copilot