Strategies we backtested ATR trailing stop strategy

Tested by BacktestingMax

ATR trailing stop strategy backtest

Does the ATR trailing stop strategy make money?

Mostly no: 17 out of 30 backtests lost money after trading costs. But on 4-hour charts, 6 out of 10 markets made money. The strategy follows one line that trails the price at 3 times the ATR, which is how far price moves in an average candle. It buys when a candle closes back above the line, and sells short when a candle closes back below it. We ran the 30 backtests from 2020 to 2025: 10 markets, each on 15-minute, 1-hour and 4-hour charts. 7 of them made money in both 2020–2023 and 2024–2025. Most currency pairs lost money. On 15-minute charts, a wider 4 × ATR line made money on 6 out of 10 markets, and a tighter 2 × ATR line on only 1 out of 10. A trend filter helped a little: only buy when the price is above the 200 EMA, an average of the last 200 closes, and only sell short below it. In 2024–2025, the years we did not use to pick it, 17 out of 30 backtests made money with it, compared with 14 without it. The strategy is almost always in a trade, so a real account would usually also pay overnight fees, which these results leave out.

30 backtests 2020–2025 Trading costs included Tested 9 November 2026

Where it worked 30 backtests
Made money
13
of 30 tests, with the standard rules
Made money in both periods
7
2020–2023 and again 2024–2025
Best backtest
+238%
Nasdaq 100, 15-minute chart: account growth 2020–2025
With a 200 EMA trend filter
11
tests made money in both periods, compared with 7 with the standard rules

Made money in both periods

  • USD/JPY, 1-hour
  • Gold, 1-hour
  • Gold, 4-hour
  • Silver, 4-hour
  • Nasdaq 100, 15-minute
  • Dow Jones, 4-hour
  • DAX, 1-hour

The results

Results on every market

Each box shows one backtest of the ATR trailing stop strategy with the standard rules, from 2020 to 2025, after trading costs: the % result, and a small chart of the account balance. The solid line is the account balance and the dashed line is the starting balance. Green results made money; red results lost money. Under each result: whether it made money in both 2020–2023 and 2024–2025, or passed all four of our checks (see "How a test passes" further down).

Market 15-minute 1-hour 4-hour
EUR/USD −94% Lost money. Account down 90% by Sept 2024 +3% Made money overall, lost in one period −13% Lost money
GBP/USD −97% Lost money. Account down 90% by Feb 2024 −46% Lost money −13% Lost money
USD/JPY −11% Lost money +182% Made money in both periods +4% Made money overall, lost in one period
AUD/USD −97% Lost money. Account down 90% by Dec 2024 −37% Lost money −13% Lost money
Gold −84% Lost money +79% Made money in both periods +15% Passed all four checks
Silver −95% Lost money. Account down 90% by Jan 2022 −15% Lost money +43% Passed all four checks
Nasdaq 100 +238% Made money in both periods −22% Lost money +3% Made money overall, lost in one period
S&P 500 −28% Lost money −34% Lost money −13% Lost money
Dow Jones +65% Made money overall, lost in one period −28% Lost money +19% Made money in both periods
DAX +50% Made money overall, lost in one period +81% Made money in both periods +31% Made money overall, lost in one period
All the numbers, test by test
Market Chart Trades Win rate Profit factor Result Max drawdown 2020–2023 2024–2025 Monte Carlo drawdown Trading costs
EUR/USD 15-minute 4,231 31.3% 0.88 −94.1% −94.6% −87.1% −54.3% −97.1% $7,391
EUR/USD 1-hour 1,022 33.4% 1.01 +2.9% −34.5% −7.5% +11.2% −52.6% $2,402
EUR/USD 4-hour 279 34.4% 0.90 −12.7% −32.0% −12.5% −0.2% −33.0% $291
GBP/USD 15-minute 4,240 32.1% 0.87 −96.6% −97.1% −89.2% −68.1% −97.9% $7,235
GBP/USD 1-hour 1,057 33.6% 0.91 −45.9% −66.2% −21.2% −31.4% −64.5% $2,381
GBP/USD 4-hour 269 32% 0.89 −12.7% −28.3% −14.3% +1.9% −32.2% $269
USD/JPY 15-minute 4,091 32.8% 0.99 −10.8% −73.7% −29.7% +26.9% −82.5% $17,729
USD/JPY 1-hour 944 36.4% 1.24 +181.6% −23.5% +87.1% +50.5% −36.3% $2,817
USD/JPY 4-hour 269 36.4% 1.03 +4.3% −22.5% −4.9% +9.7% −28.4% $253
AUD/USD 15-minute 4,178 32.6% 0.87 −96.6% −97.1% −81.0% −82.2% −97.9% $8,456
AUD/USD 1-hour 1,060 34.2% 0.92 −37.1% −53.8% −28.9% −11.5% −67.0% $2,696
AUD/USD 4-hour 254 37% 0.88 −13.4% −20.5% −7.8% −6.1% −29.1% $320
Gold 15-minute 3,510 30.9% 0.90 −83.7% −89.3% −74.8% −35.3% −92.3% $7,933
Gold 1-hour 913 35.5% 1.13 +79.2% −21.4% +69.4% +5.8% −40.3% $2,836
Gold 4-hour 245 40.8% 1.15 +15.1% −19.3% +0.7% +14.3% −21.0% $231
Silver 15-minute 1,648 25.9% 0.67 −95.4% −95.4% −94.9% −9.2% −96.6% $6,416
Silver 1-hour 855 33.7% 0.97 −14.5% −49.0% −1.7% −13.0% −51.5% $5,055
Silver 4-hour 210 38.6% 1.43 +42.7% −7.0% +19.1% +19.8% −16.5% $578
Nasdaq 100 15-minute 3,894 33.2% 1.07 +237.8% −44.7% +81.1% +86.5% −71.3% $17,517
Nasdaq 100 1-hour 1,050 33.3% 0.96 −22.0% −51.7% +24.9% −37.5% −56.9% $1,424
Nasdaq 100 4-hour 296 35.1% 1.03 +3.3% −15.7% −0.2% +3.5% −26.7% $132
S&P 500 15-minute 4,008 32.9% 0.99 −28.3% −69.8% −12.3% −18.3% −84.1% $13,636
S&P 500 1-hour 1,070 31.2% 0.93 −34.1% −49.7% −0.2% −34.0% −66.7% $1,401
S&P 500 4-hour 294 34% 0.91 −13.4% −28.2% +2.8% −15.8% −33.1% $186
Dow Jones 15-minute 3,909 32.8% 1.02 +64.8% −63.8% −7.3% +77.7% −76.0% $11,058
Dow Jones 1-hour 1,042 33.1% 0.94 −27.7% −50.3% −21.3% −8.1% −59.6% $841
Dow Jones 4-hour 261 38.3% 1.18 +19.4% −14.3% +13.8% +4.9% −19.5% $130
DAX 15-minute 3,944 33.1% 1.02 +50.0% −83.5% −52.1% +213.1% −76.3% $9,123
DAX 1-hour 1,030 33.4% 1.13 +80.7% −31.4% +13.3% +59.5% −42.9% $1,098
DAX 4-hour 273 35.5% 1.19 +30.8% −16.7% +50.6% −13.2% −24.7% $176

Profit factor is the money won divided by the money lost. Above 1 means the test made money. Max drawdown is the biggest fall from the highest balance. 2020–2023 and 2024–2025 show the result in each period on its own. Monte Carlo drawdown: we shuffled the trades into a random order 1,000 times; in 95% of those runs, the worst drawdown was this number or less. Result is the change in the account, with the risk of each trade set to 1% of the account at that time.

The account balance

The best test and the middle test

Best test Nasdaq 100, 15-minute chart +237.8% from 2020 to 2025
Middle test (median): half of the 30 did better, half did worse GBP/USD, 4-hour chart −12.7% from 2020 to 2025

What we found

What the 30 backtests show

  1. With the standard rules (a 3 × ATR line), 13 out of 30 backtests made money from 2020 to 2025, after trading costs. 7 of them made money in both 2020–2023 and 2024–2025. The 4-hour charts did best: 6 out of 10 markets made money, and the gold and silver backtests passed all four of our checks. The 15-minute charts did worst: 7 out of 10 markets lost money, and 4 of those accounts ended more than 90% down. Only 3 out of 12 currency-pair backtests made money. GBP/USD, AUD/USD and the S&P 500 lost money on all 3 charts. The best backtest was the Nasdaq 100 on the 15-minute chart: the account grew 237.8%, with gains in both periods.

  2. The best distance for the line depended on the chart. On this page, R is the money a trade risked: 1% of the account when the trade opened. So +0.026R means that the average trade made 2.6% of the money it risked. On 15-minute charts, the wider the line, the better. 1 out of 10 markets made money with a 2 × ATR line, 3 out of 10 with 3 × ATR, and 6 out of 10 with 4 × ATR. The 4 × ATR line made half as many trades: 25,254 on the 10 markets, compared with 50,669 with 2 × ATR. Even before trading costs, its trades made more on average: +0.026R, compared with +0.017R. On 4-hour charts, the tighter line did better instead. The average 2 × ATR trade made +0.036R after costs, compared with +0.026R with 3 × ATR and +0.012R with 4 × ATR. The 2 × ATR line made money on the same 6 markets as the 3 × ATR line, and a bigger profit on 5 of them. On 1-hour charts, no line was clearly best.

  3. A 15-minute chart does not make this a day-trading strategy. The strategy is almost always in a trade, so a trade is usually open at 17:00 New York time, when most brokers charge an overnight fee (a swap). With the standard rules, in 29 out of 30 backtests, a trade was open at that time on 80% to 94% of weekdays. The one exception was silver on the 15-minute chart, at 51%, because its account had fallen so far that most trades were skipped. Half of the 15-minute trades lasted 5.8 hours or less, but most trades opened just one candle after the trade before them closed. Our results leave out overnight fees. A real account would pay one, or sometimes receive one, on most weekdays, on every chart.

  4. We also ran 10 daily-chart backtests, separate from the 30, from 2014 to 2025, because a daily chart gives few trades. With the standard rules, the 10 markets made 787 trades in those 12 years, from 39 to 100 per market. 4 out of 10 markets made money, and the best result was +3.8%, on the USD/JPY account. On the Dow Jones, the backtest skipped 57 out of 96 trades that the rules asked for. Even the smallest trade size risked more than 1% of the account (see 'Smallest trade size'). With the 200 EMA filter, 7 out of 10 markets made money. But that left only 22 to 54 trades per market in 12 years, too few to tell whether the filter works or the result is luck.

2, 3 or 4 × ATR

Which distance for the line did best, chart by chart

Each row shows the trades of one line on one chart, with all 10 markets added together, after trading costs. The line is 2, 3 or 4 times the ATR of the last 14 candles from the close, and 3 is the standard rules. The dates are 2020 to 2025, and 2014 to 2025 on daily charts. The averages are for one trade, in R.

Chart Line Trades a year, middle market of the 10 Average trade before costs Trading costs per trade Average trade after costs Markets that made money
15-minute 2 × ATR 757 +0.017R 0.065R −0.047R 1 out of 10
15-minute 3 × ATR (standard rules) 663 +0.022R 0.043R −0.022R 3 out of 10
15-minute 4 × ATR 438 +0.026R 0.032R −0.007R 6 out of 10
1-hour 2 × ATR 297 +0.055R 0.037R +0.018R 6 out of 10
1-hour 3 × ATR (standard rules) 173 +0.034R 0.022R +0.012R 4 out of 10
1-hour 4 × ATR 114 +0.039R 0.015R +0.025R 6 out of 10
4-hour 2 × ATR 79 +0.053R 0.018R +0.036R 6 out of 10
4-hour 3 × ATR (standard rules) 45 +0.036R 0.009R +0.026R 6 out of 10
4-hour 4 × ATR 28 +0.019R 0.007R +0.012R 5 out of 10
Daily 2 × ATR 13 +0.026R 0.008R +0.018R 4 out of 10
Daily 3 × ATR (standard rules) 7 −0.047R 0.005R −0.051R 4 out of 10
Daily 4 × ATR 4 −0.028R 0.003R −0.032R 3 out of 10

We added up the results of all the trades in each group and divided by the number of trades. 'Middle market of the 10' means that half of the markets made more trades and half made fewer. Because of rounding, the average before costs minus the costs can differ from the average after costs by 0.001R. On daily charts, many trades were skipped with the 3 × ATR and 4 × ATR lines, because the smallest trade size risked more than 1% (see 'Smallest trade size').

The strategy

What the ATR trailing stop strategy is

ATR (average true range) is an indicator that measures volatility: how far price moves in an average candle, including any jump from the previous candle's close. An ATR trailing stop is a line that follows the price at a distance of a few ATRs. We used 3 times the ATR of the last 14 candles, a common setting. In an uptrend, the line sits below the price. When the price rises, the line moves up with it, but it never moves down. When a candle closes below the line, the trend turns down, and the line jumps above the price. In a downtrend, the line moves down with the price and never up. Many traders use this line as a trailing stop-loss: a stop-loss that follows the price to keep part of the profit. The ATR trailing stop strategy also uses the line to enter trades. It buys when the trend turns up, and sells short (sells first and buys back later, to make money if price falls) when the trend turns down. So it is almost always in a trade. In our backtest, a close on the other side of the line ends each trade. Our backtest engine cannot move a stop-loss, so each trade also has a fixed stop-loss where the line was when the trade opened.

ATR trailing line
3 × ATR(14) from the close. ATR(14) is the standard average true range (Wilder's) of the last 14 candles. The true range of a candle is the distance from its high to its low, or more if price jumped from the previous candle's close. This is the line that the 'ATR Trailing Stops Colored' indicator in BacktestingMax draws, with its multiplier set to 3 (its default is 2). We worked out the line ourselves, on the same candles the rules use (see 'Price data').
Stop-loss
Fixed where the line was when the order was placed, because our backtest engine cannot move a stop-loss. That is 3 × ATR(14) from the close when the trend has just turned. It can be closer after a one-candle wait (see 'Reversals').
Exit
A close on the other side of the line: below it for a buy, above it for a sell. The trade closes at the next candle's open. With the standard rules, 63% of the trades on 15-minute charts ended this way, 65% on 1-hour charts, 68% on 4-hour charts and 71% on daily charts. The rest hit the stop-loss.
Take-profit
None
Reversals
The close that ends a trade also starts a trade in the other direction. Our backtest engine opens a new trade only after the old one has closed. So the old trade closes at the next candle's open, and the new trade opens at the open after that, one candle later. Its size and stop-loss are worked out at the close of the candle in between. If price moved against the new trade during that candle, the line did not move, so the stop-loss was closer than 3 × ATR. This happened in about 1 trade in 8. If the trend turned back during that candle, the new trade went the way of the trend at that close. We measured what the wait changed. The new trade got a better price than the old trade's exit in about half of the reversals, and a worse price in the other half. On average, the difference was close to zero.
Risk per trade
1% of the account, which started at $10,000. The trade size is worked out at the close of the candle before the entry, from the distance to the stop-loss, and rounded down to a size the market allows. The trade opens at the next candle's open. So a loss at the stop-loss was usually close to 1% of the account, but not exactly 1%. It was bigger when price jumped between that close and the next open, or jumped past the stop-loss. With the standard rules, 61 out of 37,653 trades on 15-minute charts lost more than 1.5% of the account. So did 14 out of 10,043 trades on 1-hour charts and 1 out of 2,650 on 4-hour charts, and no daily trade. The biggest loss, 6.3% of the account, was a Nasdaq 100 trade on the 15-minute chart on 2 February 2023. The Nasdaq 100 does not trade from 17:00 to 18:00 New York time. The trade size was set at 17:00, when the stop-loss was only about 10 points away. At 18:00, price opened about 50 points higher, so the trade opened about 60 points from its stop-loss. Then price fell to the stop-loss.
Trading costs
Each trade pays the spread, which is the gap between the buy price and the sell price. On currency pairs, the spread is in pips: a pip is 0.0001 on EUR/USD, GBP/USD and AUD/USD, and 0.01 on USD/JPY. The spread is 0.8 pips on EUR/USD, 1.2 on GBP/USD, 0.9 on USD/JPY and 1.0 on AUD/USD. It is $0.30 an ounce on gold and $0.020 on silver. On the indices, it is 0.4 points on the S&P 500, 1.5 on the Nasdaq 100, 2.0 on the Dow Jones and 1.0 on the DAX. For silver, the Nasdaq 100, the Dow Jones and the DAX, these spreads are wider than the spreads BacktestingMax uses by default, to match a typical retail broker. These rules use only market orders and stop-losses, so every trade pays half the spread when it opens and half when it closes. With the standard rules, the spread cost a trade 0.043R on average on 15-minute charts, 0.022R on 1-hour charts, 0.009R on 4-hour charts and 0.005R on daily charts. There is no commission. The backtest adds no other slippage. A market order fills at the next candle's open, and a stop-loss at its price, or at the first price past it if price jumped.
Smallest trade size
Sometimes the trade size that risks 1% is smaller than the smallest trade the market allows. The smallest trade is 1,000 units of a currency pair, 1 ounce of gold, 50 ounces of silver or 0.1 of an index contract. Then the backtest skips the signal, which is the close on the other side of the line that tells the strategy to open a trade. With the standard rules, the 15-minute backtests skipped 2,345 out of 39,999 signals, 2,045 of them on silver. All but 5 of these 2,345 came after the account had fallen below half of its starting balance. The 1-hour backtests skipped 19 out of 10,063 signals, and the 4-hour backtests 21 out of 2,672. On daily charts, the line is far from the price, so even the smallest trade often risked more than 1% of the account. The daily backtests skipped 125 out of 912 signals, and 57 out of 96 on the Dow Jones. With the 4 × ATR line, they skipped 134 out of 568, and 44 out of 64 on the Dow Jones. Our backtest engine also does not allow a trade worth more than 30 times the account balance, and a very close stop-loss can need a bigger trade than that. With the standard rules, this happened in 113 trades on 15-minute charts, 18 on 1-hour charts and 1 on a 4-hour chart. Those trades risked less than 1%.
Price data
We used CFD prices: the prices a broker quotes for a CFD (contract for difference), the product most brokers outside the US offer for trading these markets. The strategy skips two kinds of candle, and these candles don't count for the ATR, the line or the 200 EMA. The first kind is a tiny extra candle after the weekly close at 17:00 New York time, from a few minutes of prices that some Fridays have in our data. The second kind is a candle with no price change at all (the high equals the low), for example on a market holiday. In the backtests from 2020 to 2025, these were less than 0.6% of the candles in every backtest. In the daily backtests from 2014 to 2025, they were 5.3% of the Nasdaq 100 candles, 5.7% of the S&P 500 candles and 2.6% of the DAX candles. On the Nasdaq 100 and the S&P 500, most were tiny Friday candles from 2014 to 2018. On the other markets, they were less than 0.6%.
DAX data
Our DAX data has some wrong prices, and the results on this page include them, because we test on our price data as it is. They come at times with no trading, mostly between 22:00 and 23:00 German time. They are usually about 1% away from the last real price, and at most 3.7% from 2020 to 2025. They appear on 40 days from 2020 to 2025. The daily backtests also cover 2014 to 2019, with 53 more of these days and prices up to 9.9% away. We ran the DAX backtests again without the wrong prices to see what they change. Every 15-minute and 1-hour DAX backtest did better without them, and the 15-minute ones by a lot. With the standard rules, the 15-minute DAX backtest made +309.8% instead of +50.0%, and it made money in 2020–2023 too (+23.2% instead of −52.1%). With the 4 × ATR line, it made +618.3% instead of +248.1%. With the 200 EMA filter, it made +90.5% instead of losing 4.4%. Every 4-hour DAX backtest did worse without them: with the standard rules, +21.9% instead of +30.8%, and with the 2 × ATR line, +15.3% instead of +65.1%. The daily DAX backtests changed by 4.1 percentage points or less. Without the wrong prices, 8 backtests instead of 7 would have made money in both periods with the standard rules, and 12 instead of 11 with the 200 EMA filter.
Wrong prices on other markets
We checked the other 9 markets for the same problem: minutes with no trading, at a price more than 0.75% away from the last price with trading. From 2020 to 2025, it happened on one day, on silver. On 1 June 2023, 7 of these minutes had prices up to 1.5% above the last price with trading. Without these 7 minutes, silver's results changed by 0.2 percentage points or less. From 2014 to 2018, the same problem came on 137 days on the Nasdaq 100, 71 days on the S&P 500, 4 days on silver and 1 day on gold. Of our backtests, only the daily ones include these years. Without these minutes, the Nasdaq 100's daily backtest with the standard rules lost 14.4% instead of 6.5%. The S&P 500's daily backtest with the 2 × ATR line lost 9.6% instead of 4.2%. No daily backtest changed from a loss to a profit, or from a profit to a loss. The Dow Jones and the 4 currency pairs did not have this problem.
Daily charts
10 extra backtests, separate from the 30: the same 10 markets, from January 2014 to December 2025, split into 2014–2021 and 2022–2025. A daily chart gives few trades, so it needs more years. The daily results are in the fourth point of 'What the 30 backtests show'. They are also in the daily rows of the table 'Which distance for the line did best, chart by chart'. They are not in 'Results on every market'.
Overnight fees
Not included. Brokers charge a fee (a swap), or sometimes pay one, for each night a trade stays open past 17:00 New York time. With the standard rules, half of the trades lasted longer than 5.8 hours on 15-minute charts and 27 hours on 1-hour charts. On 4-hour charts it was 140 hours (5.8 days), and on daily charts 34 days. Because the strategy is almost always in a trade, a trade was open at 17:00 on most weekdays on every chart (see 'What the 30 backtests show').

The rules we tested

  1. Work out ATR(14) and the line at the close of each candle. In an uptrend, the line is below the price. It moves up to the close minus 3 × ATR whenever that is higher, and it never moves down.
  2. In a downtrend, the line is above the price. It moves down to the close plus 3 × ATR whenever that is lower, and it never moves up.
  3. In a downtrend, when a candle closes above the line, the trend turns up: buy at the next candle's open. The line jumps to 3 × ATR below that candle's close.
  4. In an uptrend, when a candle closes below the line, the trend turns down: sell short at the next candle's open. The line jumps to 3 × ATR above that candle's close.
  5. Stop-loss: where the line is when the order is placed. Our backtest engine cannot move a stop-loss, so it stays there. If price touches it, the trade closes at once.
  6. Exit: when a candle closes on the other side of the line, close the trade at the next candle's open. The line moves with the price, so about 2 trades in 3 ended this way, before they reached the stop-loss.
  7. The close that ends a trade also starts a trade in the other direction, one candle later (see 'Reversals'). After a stop-loss, wait for the next close on the other side of the line.
  8. Risk 1% of the account on each trade, and hold one trade at a time.

The method

How we tested it

The test

Markets
EUR/USD, GBP/USD, USD/JPY, AUD/USD, Gold, Silver, Nasdaq 100, S&P 500, Dow Jones and DAX
Charts
15-minute, 1-hour and 4-hour candles
Dates
January 2020 to December 2025
Account
$10,000, risking 1% of the account on each trade
Trading costs
Included. Every trade pays that market's normal trading cost: the spread, which is the gap between the buy price and the sell price.

How a test passes

We call a test passed only if it meets all four checks. A strategy can make money in one backtest and still fail one of these checks.

  • At least 100 trades. With fewer trades, a good result could be luck.
  • It made money from 2020 to 2023 and again from 2024 to 2025. This shows whether the strategy kept working in the newer years, not only in the older ones.
  • A profit factor (the money won divided by the money lost) of at least 1.2 from 2024 to 2025, after trading costs.
  • In 95% of 1,000 random shuffles of the trades, the account must not fall more than 30% from its highest point.

Improvements

Can the ATR trailing stop strategy be improved?

We tried three changes traders often make to the ATR trailing stop: a tighter line, a wider line, and a trend filter. Each change ran on the same 30 tests. A change picked on the same years it is judged on will almost always look good. So we picked the change with the most tests that made money in 2020–2023 only. Then we checked it on 2024–2025, the years we did not use to pick it.

Version Made money 2020–2023years used to pick the best version Made money 2024–2025years not used to pick it Made money in both periods Passed all four checks
Standard rules: a 3 × ATR line The rules under 'The rules we tested', with nothing added. 10 of 30middle test −7.4% 14 of 30middle test −3.1% 7 2
With a tighter 2 × ATR line The line is 2 × ATR(14) from the close instead of 3 × ATR. The trend turns sooner, so the strategy trades more often, with a closer stop-loss. 13 of 30middle test −17.9% 12 of 30middle test −4.8% 8 0
With a wider 4 × ATR line The line is 4 × ATR(14) from the close instead of 3 × ATR. The trend turns later, so the strategy trades less often, with a wider stop-loss. 15 of 30middle test −0.8% 14 of 30middle test −3.4% 11 5
With a 200 EMA trend filterBest on 2020–2023 Only buy when the close is above the 200 EMA, and only sell short when it is below. The 200 EMA is a moving average of the last 200 closes that gives more weight to recent prices. If the line turns against an open trade, the trade still closes. The next trade opens only on a turn that agrees with the EMA: up while the close is above it, or down while it is below. 19 of 30middle test +2.7% 17 of 30middle test +1.2% 11 4

A little. On 2020–2023, the years we used to pick the best change, the 200 EMA trend filter did best. With it, 19 out of 30 tests made money, compared with 10 with the standard rules. On 2024–2025, the years we kept for the check, it still did better, but by less: 17 out of 30 tests made money, compared with 14. In 2024–2025, the middle test made +1.2% with the filter, and lost 3.1% without it. With the filter, 11 tests made money in both periods, compared with 7, and 6 of those 11 were on 4-hour charts. On 1-hour charts, the filter did not help: 4 out of 10 markets made money with it and without it. The wider 4 × ATR line also made money in both periods in 11 tests, and it passed all four checks in 5 tests, the most of any version. But in 2024–2025 alone, it made money in 14 out of 30 tests, the same as the standard rules. The tighter 2 × ATR line passed none.

Passed all four checks with a 200 EMA trend filter

  • USD/JPY, 1-hour
  • USD/JPY, 4-hour
  • Gold, 1-hour
  • Silver, 4-hour

Questions

Questions traders ask

Does the ATR trailing stop strategy work?

Mostly no. We ran 30 backtests from 2020 to 2025, with trading costs: 10 markets, each on 15-minute, 1-hour and 4-hour charts. With the standard rules, 13 out of 30 made money, and 7 made money in both 2020–2023 and 2024–2025. It did best on 4-hour charts, where 6 out of 10 markets made money. It did worst on currency pairs, where 3 out of 12 tests made money. A 200 EMA trend filter helped a little: in 2024–2025, 17 out of 30 tests made money with it, compared with 14 without it.

What is the best ATR multiplier for a trailing stop?

The multiplier is how many ATRs the line sits from the price. In our backtest, the best one depended on the chart. On 15-minute charts, 4 × ATR did best: 6 out of 10 markets made money. With 3 × ATR, 3 out of 10 did, and with 2 × ATR, only 1 out of 10. A tighter line turns more often, so it trades more and pays the spread more often. On 4-hour charts, 2 × ATR made the most per trade, and it made money on the same 6 out of 10 markets as 3 × ATR. Over all 30 tests, 4 × ATR most often made money in both 2020–2023 and 2024–2025. It did so in 11 tests, compared with 8 for 2 × ATR and 7 for 3 × ATR.

Is the ATR trailing stop the same as Supertrend?

Almost. Both draw a line a few ATRs from the price, and the line moves only with the trend. With both, the trend turns when a candle closes on the other side of the line. Supertrend measures the distance from the middle of the candle, halfway between the high and the low, and usually uses the ATR of 10 candles. The ATR trailing stop measures it from the close and usually uses 14 candles. We ran Supertrend with its default settings, 3 times the ATR of 10 candles, with the same kind of rules on the same 30 tests. Supertrend made money in 16 out of 30 tests, and the ATR trailing stop in 13 out of 30. Each one had the better result in 15 out of 30 tests. But single tests could differ a lot. On the S&P 500 15-minute chart, Supertrend made +89.2% and the ATR trailing stop lost 28.3%.

What is the best timeframe for an ATR trailing stop strategy?

With the standard rules, the 4-hour chart: 6 out of 10 markets made money there. On 1-hour charts, 4 out of 10 did, and on 15-minute charts, 3 out of 10. Gold and silver on 4-hour charts passed all four of our checks. On 15-minute charts, the spread cost each trade 4.3% of the money it risked, on average. That was about twice what an average trade made before costs. With the wider 4 × ATR line, 1-hour charts did a little better than 4-hour charts: 6 out of 10 markets made money, compared with 5 out of 10. Daily charts, which we tested from 2014 to 2025, gave only 39 to 100 trades per market in 12 years, and 4 out of 10 markets made money.

Keep exploring

Related strategies we tested

Keltner Channels Keltner channel breakout strategy backtest Made money in 10 of 30 tests, 8 of them in both periods. Best: Nasdaq 100, 15-minute, +244% Supertrend Supertrend (10, 3) strategy backtest Made money in 10 of 36 tests, 4 of them in both periods. Best: USD/JPY, 1-hour, +104% MACD MACD crossover strategy backtest Made money in 6 of 21 tests, 4 of them in both periods. Best: DAX, 1-hour, +294%
The strategy code we ran

This is the exact code from the BacktestingMax strategy engine. Paste it into the strategy editor in the app to run it on any market.

class AtrTrailingStopStrategy(Strategy):
    """The ATR trailing stop strategy: always in the market, long above the line and short
    below it, plus the changes traders often make.
    The trailing line (the classic ATR trailing stop, as in BacktestingMax's "ATR Trailing
    Stops Colored" indicator and most TradingView scripts), worked out at each candle's close:
      ATR = Wilder's average true range of the last 14 candles (as the built-in ATR).
      In an uptrend the line sits below the price: line = max(line before, close - 3 x ATR).
      It can only move up. When a candle closes below the line, the trend turns down and the
      line jumps above the price: line = close + 3 x ATR. In a downtrend the line can only
      move down: line = min(line before, close + 3 x ATR). When a candle closes above the
      line, the trend turns up and the line jumps to close - 3 x ATR.
    Standard (all switches off):
      Buy at the next open when a candle closes above the line (the trend turns up). Sell
      short at the next open when a candle closes below the line (the trend turns down).
      The same close is the exit of the open trade: it closes at the next open, and the new
      trade opens one candle later, once the old trade has closed (the engine opens a new
      trade only when no trade is open). If the trend turned back on that candle, the new
      trade goes the way of the trend on that candle.
      Stop-loss: the line when the order is placed, 3 x ATR from the close for a fresh flip.
      It does not move (the engine cannot move a stop). The line moves, and a close beyond
      the line closes the trade, so the stop-loss only closes a trade when price jumps or
      spikes past the line in the middle of a candle. After a stop-loss, wait for the next
      flip.
      Size: 1% of the account lost at the stop-loss, from the close of the candle before the
      entry. When that is less than the smallest trade size the market allows, the signal is
      skipped. One trade at a time.
    Skipped candles: a candle that opens on a Friday at 17:00 New York time or later, or on a
    Saturday (some index and silver data has a few minutes of prices after the weekly close,
    which make a tiny extra candle), and a candle with no range (high = low, a market holiday).
    The strategy ignores them: they don't go into the ATR, the line or the EMA, and they give
    no signal. That is why the ATR and the EMA are worked out here instead of with the
    built-in indicators. On a market that trades at the weekend, remove the Friday and
    Saturday rule.
    The changes, one at a time:
      mult = 2           a tighter line: 2 x ATR from the close instead of 3
      mult = 4           a wider line: 4 x ATR from the close instead of 3
      ema_filter = 1     only buy when the close is above the 200 EMA, only sell short when
                         it is below. A flip the other way still closes the open trade, but
                         no new trade opens until the next flip that agrees with the EMA
    """
    params = {"atr_period": Param(type=int, default=14, min=1, max=200),
              "mult": Param(type=float, default=3.0, min=0.5, max=10.0),
              "ema_filter": Param(type=int, default=0, min=0, max=1),
              "ema_period": Param(type=int, default=200, min=2, max=500)}
    lookback = 2
    def init(self, ctx):
        self.ny = ctx.clock("America/New_York")
        self.prev_close = None    # close of the previous candle used
        self.atr = None           # Wilder's ATR
        self.atr_seed = []
        self.ema = None           # the 200 EMA of the close (ema_filter)
        self.ema_seed = []
        self.line = None          # the trailing line
        self.up = None            # True: uptrend, the line is below the price
        self.pending = False      # a flip seen while the old trade was closing
    def on_bar(self, ctx):
        high, low, close = ctx.high[0], ctx.low[0], ctx.close[0]
        weekday, hour = self.ny.weekday, self.ny.hour
        if (weekday == 4 and hour >= 17) or weekday == 5 or high <= low:
            return  # a tiny candle after the Friday close, or a candle with no range
        # Wilder's ATR on the candles used, started with the simple average of the first ones.
        if self.prev_close is None:
            true_range = high - low
        else:
            true_range = max(high - low, abs(high - self.prev_close), abs(low - self.prev_close))
        self.prev_close = close
        n = ctx.params.atr_period
        if self.atr is None:
            self.atr_seed.append(true_range)
            if len(self.atr_seed) == n:
                self.atr = sum(self.atr_seed) / n
        else:
            self.atr += (true_range - self.atr) / n
        m = ctx.params.ema_period
        if self.ema is None:
            self.ema_seed.append(close)
            if len(self.ema_seed) == m:
                self.ema = sum(self.ema_seed) / m
        else:
            self.ema += (close - self.ema) * 2.0 / (m + 1)
        if self.atr is None:
            return
        # The trailing line.
        loss = ctx.params.mult * self.atr
        if self.line is None:
            self.line, self.up = close - loss, True   # start in an uptrend; trade from the first flip
            return
        flip = False
        if self.up:
            if close < self.line:
                self.line, self.up, flip = close + loss, False, True
            else:
                self.line = max(self.line, close - loss)
        else:
            if close > self.line:
                self.line, self.up, flip = close - loss, True, True
            else:
                self.line = min(self.line, close + loss)
        pos = ctx.position
        if pos is not None:
            if flip:
                ctx.close_position()   # fills at the next open
                self.pending = True
            return
        # No trade open: trade a flip on this candle, or one seen while the old trade closed.
        go, self.pending = flip or self.pending, False
        if not ctx.gate("atr_line_flip", go):
            return
        if ctx.params.ema_filter == 1:
            if self.ema is None:
                return
            agrees = close > self.ema if self.up else close < self.ema
            if not ctx.gate("ema_agrees", agrees):
                return
        stop, entry = self.line, close
        if (stop >= entry) if self.up else (stop <= entry):
            return
        size = ctx.size_by_risk_pct(0.01, stop=stop, entry=entry)
        if size <= 0:
            return  # 1% of the account is less than the smallest trade size: skip the signal
        if self.up:
            ctx.buy(size=size, sl=stop, tag="atr_trail_long")
        else:
            ctx.sell(size=size, sl=stop, tag="atr_trail_short")

Your turn

Test the ATR trailing stop strategy yourself

Change the settings, the market or the stop-loss and see the result in seconds. Ask the BacktestingMax AI: Backtest the ATR trailing stop strategy, ATR 14 and multiplier 3, with a 200 EMA trend filter on silver, 4-hour chart.

Try it free in BacktestingMax

Free account. No credit card needed.

See every strategy we tested Browse strategies shared by traders

Backtest on historical data with trading costs, run by BacktestingMax. Past results do not guarantee future results, and nothing here is financial advice. Updated 9 November 2026.