ATR Trailing Stop

The ATR Trailing Stop follows the close itself at a multiple of the Average True Range. It goes back to the Volatility System of J. Welles Wilder, who placed his stop a multiple of the Average True Range away from the extreme close of the trend, and Sylvain Vervoort formulated it as a trailing stop: it only rises while the close stays above it, only falls while the close stays below it, and jumps to the other side of the close when the close crosses it.

The formula for the ATR Trailing Stop starts from the loss, the distance of the stop from the close: k Average True Ranges over the last n periods, the Average True Range being Wilder’s moving average of the True Range, the largest of the period’s range and the distances of its high and low from the previous close:

\[\text{Loss} = k \cdot \text{ATR}(n)\]

While the close and the close before are both above the previous stop, the stop rises with the close and never falls; while both are below, it falls with the close and never rises:

\[\text{Stop} = \max\left(\text{Stop}_{t-1}, \text{Close} - \text{Loss}\right) \quad \text{if } \min\left(\text{Close}, \text{Close}_{t-1}\right) > \text{Stop}_{t-1}\] \[\text{Stop} = \min\left(\text{Stop}_{t-1}, \text{Close} + \text{Loss}\right) \quad \text{if } \max\left(\text{Close}, \text{Close}_{t-1}\right) < \text{Stop}_{t-1}\]

When the close crosses the previous stop, the stop restarts on the other side of the close:

\[\text{Stop} = \text{Close} - \text{Loss} \quad \text{if } \text{Close} > \text{Stop}_{t-1}\] \[\text{Stop} = \text{Close} + \text{Loss} \quad \text{if } \text{Close} \leq \text{Stop}_{t-1}\]

Vervoort uses a 5-period Average True Range and a multiple of 3.5. A stop below the close marks an uptrend and protects a long position, a stop above it a downtrend and a short position, and a close through the stop ends the position. Because it follows the close rather than the median price or an average, it reacts faster than the Supertrend and the Profit Maximizer and flips more often.

The stop is a multiple of the Average True Range away from the price (the median price for the Supertrend, the close for the ATR Trailing Stop), or for the Profit Maximizer from its moving average.

Also known as: ATRTS, volatility stop, ATR stop.

In the Finance Toolkit this is get_supertrend with method="atr_trailing_stop", the same function as Supertrend.

Example · SHOP · 2025

Install the Finance Toolkit with pip install financetoolkit -U, then call get_supertrend:

from financetoolkit import Toolkit

toolkit = Toolkit(
    tickers=["SHOP"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2025-01-01",
    end_date="2025-12-31",
)

toolkit.technicals.get_supertrend(method="atr_trailing_stop").xs("SHOP", level=1, axis="columns")

Which returns:

References

  • Paper Wilder, J.W. Jr. (1978). “New Concepts in Technical Trading Systems.” Trend Research (the Volatility System).
  • Paper Vervoort, S. (2009). “Average True Range Trailing Stops.” Technical Analysis of Stocks & Commodities, 27(6), 34-40.
  • Library Shares similar logic as pandas-ta’s atrts (ATR Trailing Stop)
Share