Trailing stop formula: percent, points, ATR and how to test the distance
For a long trade the trailing stop is the highest high since entry minus a distance written as a percent, fixed points or an ATR multiple; it moves up on new highs and never down. Read the distance from where losing trades turned against you, then test a small ladder of distances against a run with no stop and keep only a distance whose neighbours behave alike.
By Soren Huang · Published · updated · Editorial policy
Contents
- What is the trailing stop formula?
- How do you calculate a trailing stop on a long trade, bar by bar?
- What is the difference between a trailing stop and a fixed stop loss?
- What percent or ATR multiple is a good trailing stop?
- How do you test trailing stop distances without overfitting?
- How does the stop distance change how many contracts you trade?
- Frequently asked questions
- References
What is the trailing stop formula?
The trailing stop formula for a long trade is: stop = highest high since entry − distance. The distance is written as a percent of price, a fixed number of points or a multiple of ATR. The stop rises each time price makes a new high and never moves down. Test the distance with a ladder against a run with no stop.
A trailing stop is an exit price that follows an open trade at a set distance behind the best price the trade has reached, so that part of an open gain is kept if price turns. Think of a dog on a leash walking behind you: it can follow you forward, but the leash never lets it fall further behind than its length. The one formula in this article is:
stop (long trade) = highest high since entry − distance
Here the highest high since entry is the top price reached since the trade opened, including the entry bar, and the distance is how far below that top you allow price to fall before you exit. For a short trade you mirror it in words: the lowest low since entry plus the distance. The distance itself can be written in three ways:
| Way of writing the distance | Percent | Points | ATR multiple |
|---|---|---|---|
| Distance equals | percent × highest high | a fixed number of points | multiple × current ATR |
| What changes the distance | The price level | Nothing | Recent bar ranges |
| Reacts to volatility | No | No | Yes |
| Same setting works across markets | Partly | No, points differ per market | Mostly |
The Average True Range (ATR) is the average, over a set number of bars, of each bar's true range, which is the bar's high-to-low span widened to include any gap from the previous close. Wilder (1978) introduced it, and it is the usual way to make a stop distance breathe with the market. The distance in points also decides how many contracts you can hold for a set dollar risk, which the free position size calculator works out from the stop distance and point value.
How do you calculate a trailing stop on a long trade, bar by bar?
Each bar you take the new highest high since entry, subtract the distance, and keep the higher of the new stop and the old stop. The order of the steps matters, because a backtest that uses a bar's high to set the stop and then checks that same bar's low against it is using information it would not have had.
- At entry, set the first stop from the entry price: entry minus the distance.
- At the open of each new bar, the stop in force is the one computed from bars that have already closed.
- Check the bar's low against the stop. If the low is at or below the stop, the trade exits at the stop price, or at the open if the bar opened below the stop (a gap), less slippage.
- If the trade survives the bar, update the highest high with this bar's high, compute highest high minus distance, and keep the higher of this value and the old stop.
- Repeat on the next bar.
Hypothetical example
A long trade is opened at 20,000 on an index future with a fixed distance of 40 points, so the first stop is 19,960. Bar 1 makes a high of 20,030 and a low of 19,985: the low is above the stop, so the stop moves up to 19,990. Bar 2: high 20,060, low 20,010, stop moves up to 20,020. Bar 3: high 20,045, low 20,025, no new high, stop unchanged at 20,020. Bar 4: high 20,100, low 20,040, stop moves up to 20,060. Bar 5: high 20,090, low 20,065, no new high, stop unchanged at 20,060. Bar 6: high 20,080, low 20,050. The low touches the stop, so the trade exits at 20,060, about 60 points above entry before costs. On the two falling bars the stop stood still; on the three rising bars it stepped up.
Two choices change the result and should be written down before any test. First, whether you trail from the high of each bar or from its close; the high gives a stop that moves sooner and sits higher. Second, whether a touch of the low counts as an exit or only a close below the stop; the touch rule exits more often and earlier. Keep the same choice across every run you compare.
What is the difference between a trailing stop and a fixed stop loss?
A fixed stop loss is one price set at entry that never moves, while a trailing stop follows the trade and locks in part of an open gain. A fixed stop loss is a price below your entry at which you accept the loss and exit; it answers one question, how much you can lose on the trade. A trailing stop answers a second question as well: how much of an open gain you are willing to give back.
| Property | Fixed stop loss | Trailing stop |
|---|---|---|
| Where it sits | Below entry, fixed for the life of the trade | Below the highest high since entry, rising with it |
| What it limits | The loss on a trade that never works | The loss and the give-back of an open gain |
| Effect on average win | None on its own | Usually smaller, because winners are cut when price pulls back |
| Effect on average loss | Caps it at the stop distance plus slippage | Caps it the same way at the start of the trade |
| Number of exits | Only trades that fall to the stop | More exits, because pullbacks also trigger it |
| Trades that rise then fall back below entry | Exit at a loss | Exit above entry if the rise was larger than the distance |
In a backtest the trailing stop changes three numbers at once: it lowers the average win, it raises the number of exits, and it often raises the win rate because small open gains are converted to small closed gains. Whether the net result improves depends on how price behaves after a pullback in your market. Kaminski and Lo (2014) show that the value of a stop rule depends on whether returns tend to continue or to reverse after a move, so the same stop can help in one market and hurt in another. Many systematic strategies use both: a fixed stop at entry and a trailing stop once the trade is in profit. The choices between fixed ticks, ATR, time and trailing exits are compared in stop loss in a futures strategy: fixed, ATR, time or trailing.
What percent or ATR multiple is a good trailing stop?
There is no single good number, because the right distance depends on how far your trades typically move against you before they work, and that changes with the market and with volatility. A percent stop and an ATR stop answer that question in different ways, and only one of them reacts when the market gets louder or quieter.
A percent distance scales with the price level, not with volatility. If the index is at the same level in a quiet month and a volatile month, a 2 percent stop is the same number of points in both. In the quiet month it is far away and gives back a large part of each gain; in the volatile month it is close and normal daily noise hits it. An ATR distance widens and narrows with recent bar ranges, so the same multiple sits further from price when bars are large. How ATR is used for both the stop and the position size is explained in ATR trailing stop: the rule, the parameters and a futures backtest.
Hypothetical example
An index future trades near 20,000 in two different months. In the quiet month the 14-bar ATR is 100 points; in the volatile month it is 250 points. A 2 percent trailing stop is 400 points in both months. A 2 × ATR trailing stop is 200 points in the quiet month and 500 points in the volatile month. In the quiet month the percent stop is twice as far from price as the ATR stop; in the volatile month it is closer than the ATR stop. Same setting, opposite behaviour.
Rather than guess a number, read it from the trades. Maximum adverse excursion (MAE) is the largest distance a trade moved against its entry price before it closed. If you plot the MAE of every trade from a run with no stop, winning trades usually cluster at small adverse moves and losing trades spread out further. A stop distance set just past where the winners' adverse moves end cuts few winners and many losers. The method, including how to plot it and what to look for, is in maximum adverse excursion: how to read a stop from MAE.
Check the distance against the market regime as well. A market regime is a stretch of time in which price behaves in one recognisable way, such as trending, ranging or highly volatile. A distance read from MAE in a trending year can be too tight for a ranging year, where price pulls back further before continuing. Split the trade list by regime and look at the MAE cloud of each part before you settle on a distance; market regime detection: three regimes and how to test them shows how to label the stretches.
How do you test trailing stop distances without overfitting?
Run a baseline with no stop first, then a small ladder of distances, and keep only a distance whose neighbours behave alike. A baseline is the same strategy run with the same costs and data but with no stop at all, and it is the number every stop test must be compared against, because a stop can only be judged by what it adds or removes from that run.
- Run the baseline with entries and exits only, costs included. Record net result, average win, average loss, number of trades and maximum drawdown.
- Choose a short ladder of distances before you look at any result, for example ATR multiples from 1.0 to 6.0 in steps of 0.5, or percents from 0.5 to 5 in steps of 0.5. A ladder of about ten values is enough to see the shape.
- Run every rung with everything else unchanged, including the trail-from-high and touch-exit choices from earlier.
- Plot net result after costs against distance. A plateau is a region where several neighbouring distances give similar results; a spike is one distance that stands far above its neighbours.
- Pick from the middle of a plateau, and only if the plateau beats the baseline. A spike is the signature of a distance that happened to miss a few bad bars in this history and is likely to fail on the next one.
- Repeat the run on the out-of-sample stretch with the chosen distance frozen, and compare its change against the baseline there.
Pardo (2008) describes this plateau test as the main defence against picking a parameter that fits one history. If the plateau is narrow or there is no plateau, the honest conclusion is that the stop distance does not matter much for this strategy, or that the stop does not help, and the baseline stands. When AlphaPrime (Valynox) runs each rung of such a ladder, its backtesting charges the same commission and slippage and fills at the next bar on every rung, so a rung that looks good is not looking good because it was filled at a price the live account could not get.
The box below shows what a baseline looks like. It comes from a real AlphaPrime run on ES daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $25 slippage charged on every trade. The rule is a stand-in: a Bulls Power indicator, part of the Elder Ray set, used as the only entry and exit, with no stop, no target and no filters. It is not a trailing stop strategy; it is the run you would add a trailing stop to. It is also the one candidate the search kept out of about a thousand variants it tried, chosen for its return against its drawdown, and picking the kept one after the fact flatters it. Neither the indicator nor a reader can be said to earn these figures.
Source: AlphaPrime product engine (CPU), run 2026-10-31. ES daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $25 slippage per trade.
| Number | Result |
|---|---|
| Net profit (closed trades) | $98,870 |
| Max drawdown | $62,462.5 |
| Trades | 249 |
| Win rate | 57.03% |
| Profit factor | 1.283 |
| Average trade | $397.07 |
| Time in market | 72.45% |

What to read in a baseline like this: the average trade of $397.07 and the time in market of 72.45 percent tell you a trailing stop would be cutting trades that are open most of the time, so its effect on the number of exits will be large. The max drawdown of $62,462.5 is the number a trailing stop is usually hoped to reduce; the ladder shows whether any distance does so without lowering the net profit of $98,870 by more than it saves.
How does the stop distance change how many contracts you trade?
A wider trailing stop means fewer contracts for the same dollar risk per trade, so the stop distance and the position size must be chosen together. The initial stop distance is the loss per contract if the trade fails at once, and dividing the dollar risk you accept by that loss gives the contract count.
In words: contracts = risk per trade ÷ (stop distance in points × point value). The risk per trade is the dollars you accept to lose if the first stop is hit, the stop distance in points is the gap between entry and the first stop, and the point value is the dollars one contract gains or loses per index point. Doubling the distance halves the contracts; halving it doubles them. Exchanges can change contract values, so check the point value on the exchange's contract page or in the free futures contract calculator before you size a trade.
Hypothetical example
A trader accepts $1,000 of risk per trade on a Nasdaq-100 future with a point value of $20 per index point. With a first stop 25 points from entry, one contract risks 25 × $20 = $500, so the trade takes 2 contracts. With a first stop 50 points from entry, one contract risks $1,000, so the trade takes 1 contract. The dollar risk is the same in both rows; the stop distance decided the size.
The second box shows how much the size alone can move the outcome. It takes exactly the same trades as the baseline above, the same entries and the same exits, and resizes them under nine money-management methods with $100,000 of capital and at most 10 contracts, using each method's report defaults. Because the trade list never changes, every difference between the rows comes from sizing. The run had no stop, so these methods were not fed a stop distance; the point they make still holds for a trailing stop, since the stop distance is one of the inputs that decides the size.
Source: AlphaPrime product engine (CPU), run 2026-10-31. Same trades as the box above, capital $100,000, at most 10 contracts.
| Method | Net profit | Max drawdown | Average contracts |
|---|---|---|---|
| Fixed contracts | $306,570 | $186,588 | 3 |
| Fixed notional | $251,270 | $156,620 | 2.51 |
| Percent of equity | $39,370 | $242,610 | 2.82 |
| Fixed dollar risk | $238,470 | $107,868 | 2.66 |
| Fixed fractional risk | $132,695 | $376,000 | 5.35 |
| Volatility target | $238,470 | $107,868 | 2.66 |
| Fixed ratio | $231,933 | $264,925 | 2.86 |
| Equity curve trading | $80,433 | $130,583 | 2 |
| Kelly | $79,045 | $62,463 | 1.08 |
With identical trades, the maximum drawdown runs from $62,463 under Kelly at 1.08 average contracts to $376,000 under fixed fractional risk at 5.35 average contracts. That spread is wider than anything a change of trailing distance produces on its own. It also shows why the stop and the size cannot be tuned one after the other: a tighter trailing distance that looks good in the ladder at one contract will, under a risk-based sizing rule, raise the contract count and with it the drawdown. Run the ladder at a fixed size first, then rerun the chosen rung with your sizing rule, and read the drawdown again. The free position size calculator gives the contract count for any rung of your ladder before you run it.
Frequently asked questions
How do you choose an ATR multiple for a trailing stop?
Run the strategy with no stop, record the maximum adverse excursion of every trade in ATR units, and note where the winners' adverse moves end. Then run a ladder of multiples, for example 1.0 to 6.0 in steps of 0.5, and pick a value from the middle of a region where neighbouring multiples give similar results. A multiple that beats its neighbours by a wide margin is usually fitted to this history and should be distrusted.
Should a trailing stop be calculated from the close or from the high?
Either works, as long as you use the same choice in every run you compare. Trailing from the high moves the stop sooner and keeps it higher, so it exits more often and gives back less of a gain. Trailing from the close moves it less often and lets the trade breathe through intrabar spikes. Write the choice down before the ladder test, because switching it afterwards is a form of tuning.
Does a trailing stop fill at the stop price?
Not always. A trailing stop is a stop order: when the price reaches it, the exit becomes a market order and fills at the next available price. On a normal bar that price is close to the stop; on a gap or a fast bar it can be well below it. A backtest should fill at the stop price minus slippage, or at the bar's open when the bar opens below the stop.
Can a trailing stop be used on a short trade?
Yes. For a short trade the stop is the lowest low since entry plus the distance, and it moves down each time price makes a new low and never moves up. The distance can be a percent, fixed points or an ATR multiple exactly as for a long trade. Test the long and short sides separately, because adverse moves are often larger on one side.
References
- Wilder, J. W. (1978). New Concepts in Technical Trading Systems. Trend Research.
- Kaminski, K. M., & Lo, A. W. (2014). When Do Stop-Loss Rules Stop Losses? Journal of Financial Markets, 18, 234–254.
- Pardo, R. (2008). The Evaluation and Optimization of Trading Strategies (2nd ed.). John Wiley & Sons.
- CME Group. E-mini Nasdaq-100 Futures Contract Specs. https://www.cmegroup.com/markets/equities/nasdaq/e-mini-nasdaq-100.contractSpecs.html

