BACKTESTING · ATR TRAILING STOP

ATR Trailing Stop Backtest in Crypto: Fees, Slippage and Break-Even Costs

An ATR trailing stop exits when price falls a multiple of ATR from its high. In a backtest, how the stop is triggered and filled inside each bar decides the result.

Short answer

An ATR trailing stop sets an exit at highest price since entry minus k × ATR (for longs). Backtests must decide whether the stop uses intrabar highs and lows or closes, and how the stop fills: in fast drops, a stop-market order fills below the trigger. Using closes delays exits; using intrabar extremes with no slippage flatters results. Model stop fills with slippage, update the trail only on closed bars and report how results change with k.

Trigger and fill models

ModelEffect
Trail on closes, exit at next openConservative, later exits
Trail on highs, exit at stop levelOptimistic
Trail on highs, exit at stop − slippageRealistic
A trailing stop in a fast drop (illustrative)A trailing stop in a fast drop (illustrative): HIGH: 62,000; stop 60,800 (k=2, ATR 600); DROP: Price gaps to 60,500; FILL: Stop-market 60,450; COST: 350 below trigger.HIGH62,000; stop 60,800 (k=2, ATR600)DROPPrice gaps to 60,500FILLStop-market 60,450COST350 below trigger
Fill quality matters more than the k choice in crashes. Original ChartsPod editorial graphic.

See ATR Trailing Stop Backtest in Crypto on live data in the free ChartsPod terminal.

Open the ChartsPod terminal

Choosing k

Illustrative net return by ATR multiple (%)Illustrative net return by ATR multiple (%): k=1.5 +8 %; k=2.5 +17 %; k=3.5 +13 %.ILLUSTRATIVE NET RETURN BY ATR MULTIPLE (%)k=1.5+8 %k=2.5+17 %k=3.5+13 %
Too tight exits on noise; too loose gives back gains. Original ChartsPod editorial graphic.

Same-bar ambiguity (stop and target in one bar) also applies; see When Stop and Target Hit in One Candle: Backtest Fill Ambiguity.

Conclusion

Related: Stop-Loss Trigger vs Fill Price: Plan for Slippage in Fast Markets, Stop-Loss Slippage: A Worked Crypto Example With Fees Included.

Trail on closed bars, fill stops with slippage and report results across ATR multiples.

Test ATR Trailing Stop Backtest in Crypto on a perpetual chart; no account is needed to chart.

Launch ChartsPod

Questions readers ask

Should the trail use highs or closes?

Either, consistently; update on closed bars.

Why model slippage on stops?

Stop-market orders fill below the trigger in fast drops.

What k is typical?

2–3 is common; test a range.

Sources and methodology

Backtest cost logic follows TradingView's Pine Script strategy documentation; indicator definitions are standard. All performance numbers are illustrative examples of the method, not results of real tests.

  1. TradingView Pine Script: Strategies — simulated fills and assumptions.
  2. TradingView Pine Script: Repainting — live vs historical calculation.
  3. ChartsPod documentation — guides for order flow, derivatives, alerts, backtests, journal and workspaces.

This article explains research tools and workflows. It is not financial advice, does not recommend buying or selling any asset and does not predict prices. Crypto derivatives carry a risk of rapid and total loss of margin.

CHARTSPOD EDITORIAL EDITION · RESEARCH AND EDUCATION ONLY · NOT FINANCIAL ADVICE.