A Fair Value Gap (FVG) occurs during aggressive single-sided price displacement where aggressive market orders consume liquidity without reciprocal two-way auction matching. On a 3-candle sequence, an imbalance forms between Candle 1's wick and Candle 3's wick.
Mathematical 3-Bar Imbalance Formula
- Bullish FVG (Demand Imbalance): Occurs when
low[0] > high[2]. The unfilled gap zone spans fromhigh[2](bottom) tolow[0](top). - Bearish FVG (Supply Imbalance): Occurs when
high[0] < low[2]. The unfilled gap zone spans fromlow[2](top) tohigh[0](bottom).
Pine Script v6 Real-Time FVG Tracker with Mitigation
//@version=6
indicator("Dynamic FVG Mitigation Tracker", overlay=true)
bullishFVG = low > high[2]
bearishFVG = high < low[2]
if bullishFVG
box.new(left=bar_index-2, top=low, right=bar_index+5, bottom=high[2], bgcolor=color.new(color.green, 80), border_color=color.green)
if bearishFVG
box.new(left=bar_index-2, top=low[2], right=bar_index+5, bottom=high, bgcolor=color.new(color.red, 80), border_color=color.red)
Figure 1: Institutional FVG retests acting as high-probability entry magnets.
Full Institutional SMC Codebase
SmartCat Algo automates FVGs, Order Blocks, and multi-stage risk management without subscription locks. Download the Pine Script v6 source today.
Get SmartCat Algo (8 One-Time)