Skip to content
StatePath
Tool Atlasmarket.fair_value_gap

Tool

Fair Value Gap (SMC)

market.fair_value_gap

MarketSmc

Inputs

No typed inputs.

Outputs

Bundle (untagged)

A bundle of fair-value-gap zones, each with its top price, bottom price, direction, and whether it has been mitigated yet. Feed it into interpretor.smc_zone to react when price enters or fills a gap.

A fair-value gap is a price imbalance left behind when the market moves so fast that three candles fail to overlap, leaving a window with no trading. Price tends to come back and 'fill' that gap, so this tool finds those windows and tells you when price returns to mitigate them.

Fair Value Gap (SMC) overview diagramfvg.gap

How it works

It scans every run of three consecutive bars and measures the gap between the first bar's extreme and the third bar's opposite extreme (for a bullish gap, candle 1's high vs candle 3's low). When that gap is at least min_gap wide it records an imbalance zone; the mitigation_method then decides how far price must re-enter the zone before the gap counts as filled. Each kept zone is emitted with its top and bottom price.

Modes

Direction options

Bullish gapbullish

Keeps only up-side imbalances, where price jumped up and left an unfilled gap below it (a demand pocket price may dip back into).

Bullish gap diagramfvg.bullish

When to use: Long-only setups that want to buy a pullback into bullish inefficiency.

Bearish gapbearish

Keeps only down-side imbalances, where price dropped fast and left an unfilled gap above it (a supply pocket price may rally back into).

Bearish gap diagramfvg.bearish

When to use: Short-only setups that want to sell a rally into bearish inefficiency.

Both sidesboth

Reports bullish and bearish gaps together, so you see every imbalance regardless of which way price displaced.

Both sides diagramfvg.bullishfvg.bearish

When to use: Two-sided strategies, or when you map all open inefficiencies before deciding bias.

Mitigation method options

Wick touchwick

Marks the gap as filled as soon as any wick pokes into the zone, the most sensitive rule.

Wick touch diagramfvg.gap

When to use: When the lightest test of the imbalance should already count as mitigated.

Close insideclose

Requires a bar to close inside the zone before it counts as filled, ignoring wicks that pierce and pull back.

Close inside diagramfvg.gap

When to use: When you want a committed re-entry, not a fleeting spike, to retire the gap.

Midpoint (50%)average

Treats the gap as filled once price reaches the halfway line of the zone, the classic 'consequent encroachment' level.

Midpoint (50%) diagramfvg.midpoint

When to use: A balanced rule between a wick touch and a full close, popular for partial fills.

Configuration

directionenum

Which side of imbalance to keep: bullish (gap below a fast up-move), bearish (gap above a fast down-move), or both.

Choices:bullishbearishboth
min_gapscalar

The smallest gap size, in price, that still counts as a fair-value gap. Larger values keep only wide, significant imbalances and discard hairline ones.

require_displacement_closescalar

When on, the middle candle must close strongly in the gap's direction (a real displacement bar), filtering out lazy three-bar windows that merely failed to overlap.

mitigation_methodenum

How price must re-enter a gap before it is considered filled: wick (any touch), close (a bar closes inside), or average (price reaches the 50% midpoint).

Choices:wickcloseaverage
max_zonesscalar

Caps how many of the most recent unfilled gaps are kept and emitted. Smaller keeps only the freshest imbalances; larger retains a deeper history of open gaps.

Connects to

Feeds into

Examples

  • In bullish direction with mitigation_method 'average', mark a long zone and wait for price to tag the 50% of an up-side gap before entering.
  • Feed the emitted zones into interpretor.smc_zone to fire a signal the first time price re-enters an unfilled bearish gap.

Common mistakes

  • Setting min_gap to 0 on a noisy symbol, which floods you with tiny, meaningless three-bar gaps.
  • Forgetting that a 'filled' gap is no longer tradable as an imbalance — once mitigated, it has done its job and price often continues.

See also