Skip to content
All library documents

ATR-Trailed Moving Average Trend-Following Strategy

Article Strategy library · Author: ChaoZhang

Summary

MilleMachine is a long/short trend-following system built around a configurable moving-average entry signal. A baseline moving average can filter trades and switch directional bias; an optional confirmation indicator adds another filter. Users can choose among several moving-average types and price sources for these components.

Risk controls size positions using a stated account risk percentage and set an initial stop distance from ATR. An optional trailing stop follows smoothed lows for long trades or highs for shorts, with an exit also possible when the entry indicator changes direction. The author describes the approach as performing well in trending markets but losing in ranges, and argues that a more robust bot should combine multiple strategy types. The material provides code and settings but no interpretable performance statistics from the referenced backtest, so profitability claims are not independently assessable; results also depend on indicator choices, market, and trading costs.

Key ideas

  • The system enters positions when a selected moving-average indicator changes slope, subject to optional baseline and confirmation filters.
  • ATR determines the initial stop distance, while position quantity is calculated from the chosen risk fraction.
  • A smoothed price series can trail the stop, using lows for long positions and highs for short positions.
  • The author identifies ranging markets as a weakness and recommends combining distinct strategy types for broader robustness.
  • The document supplies settings and code but no detailed backtest metrics to substantiate its profitability claim.

Tags

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