Skip to content
All library documents

Classifying Candle Direction with Gaps and Bar Statistics

Article MQL5 code base

Summary

This indicator describes an empirical way to classify bar direction and identify gaps in price quotes. Rather than relying only on whether a bar closes above or below its open, it evaluates the candle’s total height and body against statistical characteristics estimated from a fixed window of historical bars. It estimates minimum, maximum, and typical candle sizes, refreshes those estimates as the data window advances, and uses the maximum candle size as a reference for flagging large gaps.

Chart markers show the assessed direction and gaps, with options to hide direction labels, display adjusted direction, and filter gaps by size. The description acknowledges that a price-deviation channel could provide a more principled gap test, but says defining that channel is more difficult. It offers no numerical accuracy results or evidence that the empirical classification improves trading outcomes. The approach is therefore best understood as a chart-analysis tool whose thresholds and classifications may depend on the chosen lookback data.

Key ideas

  • Candle direction can be assessed using bar height and body statistics, not only open and close prices.
  • The indicator estimates minimum, maximum, and typical candle sizes from a rolling data window.
  • Large quote gaps are flagged using the estimated maximum candle size as a reference.
  • Users can adjust which direction and gap markers appear on the chart.
  • The description gives no accuracy or trading-performance evidence for its empirical method.

Tags

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