What it does

Fair Value Gap Zones highlights simple three-candle imbalances where price leaves a visible gap between the current bar and the candle two bars back. It is built for traders who want clean SMC-style gap context without a full order-block or liquidity suite.

Who this is for

This page is aimed at traders who already know what problem Fair Value Gap Zones is solving and want clearer notes on setup, tradeoffs, and platform coverage.

Key terms for this tool

Review the core trading and platform terms tied to this page before changing settings or using the study in a live workspace.

What it is not

Fair Value Gap Zones is a chart-context tool. It does not place trades, manage risk automatically, or promise that a specific pattern will resolve in one direction. Use it to organize decisions, not to outsource them.

Chart examples

This chart capture shows the study on a real NinjaTrader workspace. Use it as visual reference, then confirm behavior on your own instrument, session, and timeframe.

Best fit

  • Keeping displacement zones visible after a fast impulse.
  • Reviewing whether price respects, fills, or ignores recent imbalance areas.
  • Pairing gap context with liquidity sweeps, session levels, or market-structure shifts.

Before using it live

  • Import the NinjaTrader 8 ZIP through NinjaTrader's normal import flow.
  • Start with a modest minimum gap size so one-tick noise does not flood the chart.
  • Use the zones as context for displacement and revisits, not as automatic entry signals.
  • Review how the tool behaves on your actual session template, chart type, and instrument.

Settings to review

Minimum gap ticks

Filters out tiny gaps that are unlikely to matter on the selected chart.

Zone opacity

Controls how strong the gap shading appears on the price panel.

Show bullish gaps

Toggles gaps where current price leaves space above the candle two bars back.

Show bearish gaps

Toggles gaps where current price leaves space below the candle two bars back.

Installation notes

  1. Import the NinjaTrader 8 ZIP through NinjaTrader's normal import flow.
  2. Start with a modest minimum gap size so one-tick noise does not flood the chart.
  3. Use the zones as context for displacement and revisits, not as automatic entry signals.

Downloads

FreeIndicators Fair Value Gap Zones for NinjaTrader 8 NinjaTrader 8
Download

Source code

These source examples are provided for copy/paste workflows on other charting platforms. Review and test any script in a simulator before using it on a live chart.

TradeStation EasyLanguage / MultiCharts PowerLanguage FairValueGapZones.eld.txt
{
  Fair Value Gap Zones
  FreeIndicators.com source example.
  Works as a starting point for TradeStation EasyLanguage and MultiCharts PowerLanguage.
}

Inputs: MinGapTicks(2);
Vars: TickValue(0), BullGap(false), BearGap(false);

TickValue = MinMove / PriceScale;
BullGap = Low > High[2] And Low - High[2] >= MinGapTicks * TickValue;
BearGap = High < Low[2] And Low[2] - High >= MinGapTicks * TickValue;

If BullGap Then Plot1(High[2], "BullFVG");
If BearGap Then Plot2(Low[2], "BearFVG");
MetaTrader 4 MQL4 FairValueGapZones.mq4
// Fair Value Gap Zones
// FreeIndicators.com source example for MetaTrader 4.
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 DodgerBlue
#property indicator_color2 Crimson
#property indicator_color3 SeaGreen

double Buffer1[];
double Buffer2[];
double Buffer3[];

int init() {
   SetIndexBuffer(0, Buffer1);
   SetIndexBuffer(1, Buffer2);
   SetIndexBuffer(2, Buffer3);
   return(0);
}

int start() {
   int counted = IndicatorCounted();
   int limit = Bars - counted - 1;
   double minGap = 2 * Point;
   for(int i = limit; i >= 2; i--) {
      bool bullGap = Low[i] > High[i + 2] && Low[i] - High[i + 2] >= minGap;
      bool bearGap = High[i] < Low[i + 2] && Low[i + 2] - High[i] >= minGap;
      Buffer1[i] = bullGap ? High[i + 2] : EMPTY_VALUE;
      Buffer2[i] = bearGap ? Low[i + 2] : EMPTY_VALUE;
   }
   return(0);
}
MetaTrader 5 MQL5 FairValueGapZones.mq5
// Fair Value Gap Zones
// FreeIndicators.com source example for MetaTrader 5.
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_plots 3

double Buffer1[];
double Buffer2[];
double Buffer3[];

int OnInit() {
   SetIndexBuffer(0, Buffer1, INDICATOR_DATA);
   SetIndexBuffer(1, Buffer2, INDICATOR_DATA);
   SetIndexBuffer(2, Buffer3, INDICATOR_DATA);
   return(INIT_SUCCEEDED);
}

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[]) {
   int start = prev_calculated > 1 ? prev_calculated - 1 : 1;
   double minGap = 2 * _Point;
   for(int i = MathMax(start, 2); i < rates_total; i++) {
      bool bullGap = low[i] > high[i - 2] && low[i] - high[i - 2] >= minGap;
      bool bearGap = high[i] < low[i - 2] && low[i - 2] - high[i] >= minGap;
      Buffer1[i] = bullGap ? high[i - 2] : EMPTY_VALUE;
      Buffer2[i] = bearGap ? low[i - 2] : EMPTY_VALUE;
   }
   return(rates_total);
}
TradingView Pine Script v5 FairValueGapZones.pine
//@version=5
indicator("Fair Value Gap Zones", overlay=true)

minTicks = input.int(2, "Minimum gap ticks", minval=1)
minGap = minTicks * syminfo.mintick
bullGap = low > high[2] and low - high[2] >= minGap
bearGap = high < low[2] and low[2] - high >= minGap
plotshape(bullGap, "Bullish FVG", shape.square, location.belowbar, color=color.green, size=size.tiny)
plotshape(bearGap, "Bearish FVG", shape.square, location.abovebar, color=color.red, size=size.tiny)

After the download

Keep the next step tied to this exact tool

Install it cleanly, subscribe for future updates if this workflow matters, or move straight into a structured request if the tool needs another platform or a custom version.

Limitations

  • This is a simple three-candle gap detector, not a complete SMC model.
  • Gaps can remain unfilled for long periods or fail immediately.
  • Very low tick filters can create too many zones on fast intraday charts.

Frequently asked questions

Does it repaint?

This tool can revise its most recent labels or levels until enough bars have formed to confirm the swing or range it is using. Older confirmed values should be more stable than the most recent developing ones.

Which platforms are covered?

NinjaTrader 8, TradeStation EasyLanguage, MultiCharts PowerLanguage, MetaTrader 4, MetaTrader 5, TradingView Pine Script are currently represented through downloads or source pages.

Is source code included?

Yes. This page includes source examples or links to platform-specific source pages where applicable.