Skip to content
All library documents

Moving Average and ATR Bands for Trend Following

Article Strategy library · Author: ChaoZhang

Summary

This strategy uses a moving average and a volatility band built from twice the average true range to classify the market as rising or falling. It switches to an uptrend when the low moves above the upper threshold and to a downtrend when the high falls below the lower threshold; otherwise it retains the previous state. When enabled, it enters in the direction of that state, with position size set as a percentage of equity.

The document recommends testing alternative moving average and ATR settings, adding confirmation signals, and accounting for the risk of whipsaws in choppy markets. It provides parameter settings and a short BTC futures backtest window, but reports no performance results. There is a notable implementation caveat: although the explanation describes ATR-based stops and closing at a specified end date, the supplied source uses the band to update trend state and leaves its date-based close logic commented out. The two limit-mode branches also have the same entry behavior, so the document does not establish that this option changes execution.

Key ideas

  • The strategy changes trend state when price moves beyond a moving average band scaled by average true range.
  • When neither threshold is crossed, it carries forward the previous trend classification.
  • Entries follow the active trend, subject to long or short permissions and a capital allocation setting.
  • Choppy markets and poorly chosen volatility parameters can lead to repeated losses or unsuitable exits.
  • The source does not implement the described date-based close, and no backtest performance is reported.

Tags

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