Skip to content
All library documents

Filtering Candles by Direction and Doji Threshold

Article MQL5 code base

Summary

This indicator selectively highlights candles that meet a chosen visual criterion. Traders can display bullish candles, bearish candles, Doji candles, or all candles, using custom colors for the selected types while rendering other candles in a background color. Doji classification uses a configurable ratio between candle body size and total range, allowing the user to adjust how small a body must be to count as neutral.

The description outlines the indicator’s lifecycle: it maps chart data and color buffers at initialization, checks candles during calculation, and restores the chart’s original settings when removed. It suggests using directional filters to inspect price movement and Doji highlighting to spot possible consolidation or reversal areas. These are visual-analysis aids, not validated signals; the document provides no rules for trading the highlighted candles or evidence that they predict future prices.

Key ideas

  • The indicator filters chart candles by bullish, bearish, Doji, or all-candle criteria.
  • Candles matching the selected criterion receive custom colors, while others are shown in the background color.
  • Doji classification depends on a configurable ratio of candle body to total range.
  • The indicator removes selected chart elements during use and restores original settings when removed.
  • Highlighted candles may aid visual review, but the description provides no predictive or performance evidence.

Tags

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