Constructing a Dynamic ATR Trend Channel and Reversal Signals
Summary
This article explains how to build an adaptive trend indicator in MQL5. It calculates True Range using the candle range and gaps relative to the previous close, then smooths volatility in two stages: Wilder’s moving average followed by a simple moving average. The smoothed value is scaled and combined with lookback averages of highs and lows to form upper and lower channel boundaries that widen or narrow as volatility changes.
The indicator uses price movement across the boundaries to track trend state and a trailing trend line. It also colors candles by the detected direction and plots arrows when the trend changes, placing signals away from candle extremes by a volatility-based distance. The article describes the calculations, buffers, and visual plots, but the supplied text does not include the full trend-state logic or any trading results. It presents an indicator construction method, not evidence that its signals are profitable or robust across markets and settings.
Key ideas
- True Range captures both the candle’s high-low movement and gaps from the prior close.
- Wilder smoothing followed by a simple moving average produces the volatility measure used for channel width.
- Average highs and lows adjusted by the smoothed ATR form adaptive upper and lower channel boundaries.
- Price movement relative to the boundaries is used to identify trend changes and maintain a trailing trend line.
- Trend-colored candles and volatility-spaced arrows visualize direction and potential reversals, but profitability is not evaluated.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.