Trading Dev AcademyFree quant education

Free lesson · Technical analysis

Fair value gaps (FVG): three-bar geometry and fill measurement

Open interactive lessonPractice calculationsExplore labs

Start with the idea

A common FVG convention marks non-overlap between the first and third bars of a three-bar sequence. It is a chart zone, not a valuation theorem.

Symbols, units & horizon
  • L_t: third bar low in price units
  • H_(t−2): first bar high two fixed intervals earlier
  • g: bullish gap width
  • M: midpoint of the marked zone
  • t: closing timestamp of the third bar

When and why to use this

Use gap size and subsequent touch events as reproducible features or event studies.

  • For a bullish three-bar gap, the third bar’s low exceeds the first bar’s high. A bearish gap reverses the inequality.
  • The middle bar may trade through the entire marked interval. This pattern does not prove no transactions occurred there.
  • “Fair value” is a trader label; it does not establish an equilibrium price or an obligation to revisit the zone.
  • Record the zone only after the third bar closes. Freeze its boundaries, expiry and minimum size, optionally scaled by prior ATR.
  • Define a touch, midpoint visit, full traversal and invalidation separately. A gap-fill probability depends on the chosen horizon and definition.
  • Compare matched non-gap events with similar volatility and trend. Use first-touch timing and executable prices when testing a trade.
g=Lt−Ht−2>0,M=Lt+Ht−22
Specified chart rule · derivation and arithmetic

Fair value gaps (FVG): three-bar geometry and fill measurement

  1. First-bar high=102 and third-bar low=104 give gap width 104−102=2.
  2. The bullish zone is [102,104].
  3. Its midpoint is (102+104)/2=103. The bearish case instead requires third high below first low.
Work it by hand

A later low of 103.5 enters the zone but does not reach its midpoint. A later low of 101.5 crosses the full zone; actual fill prices still require an execution model.

Use the rule

  • Fix the definition, units and information timestamp.
  • Compute the example and inspect the graph.
  • Compare with a simple baseline on untouched periods after costs.

Before moving on

Write the exact rule, its availability time, an invalidation condition and a fair out-of-sample test.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

def bullish_fvg(first_high,third_low):
    if third_low<=first_high: return None
    return {"low":first_high,"high":third_low,"width":third_low-first_high,"midpoint":(third_low+first_high)/2}

print(bullish_fvg(102,104))

Continue learning

Technical Analysis: Geometry, Structure & Evidence — all lessons
  1. Support, resistance and reversal: start with a price zone
  2. Breakout detection, false breaks and retests
  3. Fibonacci retracements: anchors before ratios
  4. Harmonic patterns: ratio constraints and competing candidates
  5. Elliott Wave: count hypotheses, rules and invalidation
  6. Fair value gaps (FVG): three-bar geometry and fill measurement
  7. Heikin-Ashi: smoothed candles are synthetic prices
  8. Renko: price-driven bricks and the missing time axis
  9. Dynamic support, trend lines and Gann angles
  10. Momentum indicators, oscillators and divergence
  11. Volume, supply/demand zones and what OHLCV cannot reveal
  12. Market structure, BOS and CHOCH as a state machine
  13. Moon phases: encode a calendar hypothesis and try to falsify it

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations