Skip to content
All library documents

Multi-Timeframe Fair Value Gap Zones and Depth Histogram

Article MQL5 code base

Summary

This indicator identifies three-candle Fair Value Gaps (FVGs) across four configurable timeframes and displays unfilled zones on the active chart. A bullish gap occurs when the first candle’s high is below the third candle’s low; a bearish gap occurs when the first candle’s low is above the third candle’s high. Minimum gap size, lookback length, per-timeframe gap limits, and the retracement needed to count a gap as filled are configurable.

A separate histogram measures bullish and bearish gap depth bar by bar on the chart’s own timeframe. A dashboard reports each selected timeframe’s live gap count and combined depth. The document suggests that clusters of gaps may draw price before a trend resumes, but provides no performance evidence or tested trading rules. Zones update when the chart forms a new bar, so higher-timeframe updates can lag, especially on low chart timeframes. The tool describes imbalance visually; it does not establish that gaps predict price movement or explain how to manage trades around them.

Key ideas

  • An FVG is defined by a price region left between the first and third candles of a three-candle sequence.
  • The indicator scans four configurable timeframes and draws recent gaps that have not met the selected fill threshold.
  • A separate histogram tracks local gap depth on the active chart timeframe.
  • The dashboard summarizes live gap counts and total depth by timeframe.
  • Gap clusters are presented as a possible price magnet, but the document provides no empirical validation.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.