All indicators

Fair Value Gap

By LuxAlgoJul 28, 2023

Fair Value Gap is an indicator on Vela, our next-generation charting platform, written in Pine Script®.

Static chart image

Fair Value Gap finds the voids that aggressive moves leave behind and manages their whole life cycle on the chart. A bullish gap prints when the current low clears the high from two bars back; a bearish gap when the current high stays under the low from two bars back. Each imbalance becomes a box, and the box is deleted once a bar closes back through it, the foundational detection pattern behind the Smart Money Concepts family.

How to Trade the Fair Value Gap?

  • Fresh gap prints: one-sided pressure just left a range untraded. Treat the box as a zone of interest where price may return before continuing.
  • Price closes through a box: once a bar closes beyond the gap's far edge, the gap is mitigated and removed; enable Mitigation Levels to leave dashed lines at those prices for later retests.
  • Higher-timeframe confluence: run the Timeframe input above the chart (for example 1-hour gaps over a 15-minute chart) and favor setups that align across both.
  • Dashboard read: bullish and bearish gap counts with mitigation percentages show how reliably the market has been filling its inefficiencies lately.

Fair Value Gap Settings

  • Threshold %: the minimum size a gap must reach to count, with Auto deriving the threshold from average volatility instead.
  • Unmitigated Levels: how many of the most recent open gaps stay highlighted.
  • Mitigation Levels: draws dashed lines where gaps were filled.
  • Timeframe: runs detection on a timeframe independent of the chart.
  • Extend / Dynamic: projects boxes forward and lets subsequent price action resize their boundaries; further toggles cover dashboard visibility, corner, and text size.

Frequently Asked Questions

Free to use

Run it on Vela. Go further with a paid plan.

  • Up to 500 Custom Alerts, with webhook automation
  • Up to 10× the chart history of Free
  • Orderflow lookback up to full history
  • More Quant usage to customize it, plus extra usage when you need it
  • Futures data alongside crypto, stocks, forex and commodities
See plans
Original indicatorBuilt in-house by LuxAlgo

Run it on Vela. Make it yours with Quant.

Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.