Skip to content
All library documents

Gap Indicator for Identifying Open and Closed Price Gaps

Article MQL5 code base

Summary

The indicator marks bullish gaps with upward arrows and bearish gaps with downward arrows. Traders can set a minimum gap size in points so smaller gaps are ignored. An optional history check can identify gaps that later close, displaying a cross for closed gaps or hiding them; users can also limit how many past bars are checked.

The suggested use depends on a gap’s age and direction: a fresh, still-open gap can act as an entry filter in the direction of the gap, while an older open gap can serve as a potential target for a trade in the opposite direction. The description explains the display controls and a possible trading interpretation, but provides no formal gap definition, market-specific guidance, backtest, or evidence that either use is profitable. Signal reliability and practical results will depend on how gaps and closure are defined and on execution conditions.

Key ideas

  • The indicator marks upward and downward price gaps with directional arrows.
  • A minimum size setting filters out gaps below the chosen threshold.
  • Optional history checking can mark closed gaps or hide them, with a configurable lookback.
  • Fresh open gaps are suggested as same-direction entry filters.
  • Older open gaps are suggested as potential targets for opposite-direction trades, without supporting performance evidence.

Tags

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