Stop loss, take profit and time exits: how the exit rule rewrites a backtest
You spent weeks on the entry. The exit is a stop at 2% and a target at 4% because a video said 1-to-2 was the right ratio. Then a trader on r/Forex reports that flipping it — wide stop, quick target — was what finally worked for them, and someone else swears by exiting on time rather than price. All three are right, for three different strategies.
An exit rule is not a detail attached to an entry. It is half the strategy, and it decides the shape of every number in the report: win rate, average win, average loss, holding period, drawdown. Take one entry signal and give it a tight stop, a trailing stop, a time exit and a signal-reversal exit in turn, and you get four trade distributions that share nothing but their start dates.
This guide covers the four exit families and what each does to the distribution, why the exit is where most overfitting hides, how to test an exit without fooling yourself, and why the triple-barrier method is the honest way to define all three exits at once.
The four exit families
1. Fixed stop and target
A stop a set distance below entry, a target a set distance above. The distance can be in price, in percent, or — better — in volatility units, using the Average True Range from Wilder's New Concepts in Technical Trading Systems (1978), so that a 2-ATR stop means the same thing in a calm market and a wild one. Fixed exits make the outcome of every trade one of two numbers, which is why the win-rate arithmetic is so clean for them: the break-even win rate is 1 / (1 + target/stop).
What the distance does: a tight stop raises the number of losses and lowers the size of each one. A wide stop does the reverse. A far target lowers the win rate and raises the average win. None of these is better; they are trades between the count and the size of losses, and the right one depends on how the instrument moves after your particular entry.
2. Trailing stop
A stop that follows the price up and never comes down. It has no target — the trade runs until the market gives back a set amount. A trailing stop takes a roughly symmetric distribution of trade outcomes and skews it: many small losses and small wins, a few large wins, and no large losses if the stop is honoured. That skew is the entire point of trend following, and it is also why trend systems have win rates in the thirties and still make money.
The catch is that a trailing stop is exquisitely sensitive to its distance. Too tight and it is shaken out of every winner by noise; too loose and it gives back most of every win. The distance that looks best in a backtest is usually the one that happened to fit the last big trend's pullbacks, which is a description of overfitting.
3. Time exit
Close the trade after a fixed number of bars regardless of price. It sounds crude and it is the most honest exit there is, because it tests one thing: does the entry predict what the price does over the next N bars? No stop to tune, no target to fit. A time exit caps the holding period, which caps the exposure to a regime the entry knew nothing about, and it produces trade outcomes that look like the market's own returns over that horizon — which is exactly the thing you are trying to find an edge in.
The trader who switched to exiting on time rather than price had noticed something real: winners tend to move quickly, and losers sit. A time exit gets you out of the sitters without needing to guess a stop distance. Its cost is that it also gets you out of the slow winners.
4. Signal exit
Exit when the entry condition reverses, or when an opposite signal fires. This ties the exit to the same logic as the entry, which is elegant and dangerous in equal measure: if the entry signal is noisy, the exit is equally noisy, and the trade count explodes along with the costs. A signal exit with no stop underneath it is also the exit that produces the catastrophic single loss — the one where the reversal signal never came.
Where exits hide overfitting
The exit rule is the most common place for a backtest to quietly fit the past, for a simple reason: exits have continuous parameters and the market has a small number of memorable events. Somewhere in the parameter space there is a stop distance that would have exited the day before the 2020 crash and a trailing stop that rode the whole 2021 trend. An optimiser will find them. They will not work again, because the next crash will not give the same warning and the next trend will not pull back the same amount.
The tells are the ones from the overfitting guide, applied to the exit: the profit is concentrated in a handful of trades that one exit setting rescued; the stop distance sits on a cliff where a slightly wider or tighter value halves the return; the equity curve's smoothness comes entirely from the exit rule and disappears with a time exit. Every one of those means the exit is doing the work the entry was supposed to do.
Testing an exit honestly
- Start with a time exit. Hold the entry fixed and run it with exits at several fixed horizons — 5, 10, 20 bars. If the entry has no edge at any horizon, no stop or target will manufacture one. This is the baseline every other exit has to beat.
- Sweep, do not pick. For a stop or trailing stop, run the distance across a wide range in volatility units — 0.5 ATR to 5 ATR — and look at the whole surface. You want a broad plateau where the result is similar, not a spike.
- Read the distribution, not the total. Compare the histogram of trade outcomes under each exit. A tight stop should show many small losses; a trailing stop should show a long right tail. If the shape does not match the exit's mechanics, something else is going on.
- Check intrabar ambiguity. On bar data, a stop and a target can both be inside the same bar's range, and the backtester has to guess which was hit first. Optimistic engines assume the target. The TradingView page covers how this inflates results; the honest default is to assume the stop.
- Charge the costs of the extra trades. A signal exit that doubles the trade count doubles the spread and slippage paid. Run the cost multiplier test per exit family, not once for the strategy.
- Validate out of sample. The exit parameters are parameters. They go through the same walk-forward discipline as everything else, and an exit that only works in sample is the most common walk-forward failure there is.
The exit families side by side
| Exit | What it changes | Where it overfits | The test |
|---|---|---|---|
| Fixed stop and target | Turns every outcome into one of two numbers; sets the break-even win rate | The one stop-to-target ratio that fitted the last year's typical move | Sweep both in ATR units; look for a plateau |
| Trailing stop | Skews outcomes: many small results, a few big wins, no big losses | The distance that rode the biggest trend's pullbacks | Sweep the distance; compare the right tail out of sample |
| Time exit | Caps holding period; outcomes mirror the market's own N-bar returns | Hard to overfit — one integer parameter | Run several horizons; this is the baseline |
| Signal exit | Ties holding period to the entry logic; trade count follows signal noise | A reversal condition that never fired during the backtest's worst move | Add a stop underneath; charge costs for the extra trades |
"Should a raw strategy already be profitable?"
A question that comes up repeatedly is whether a strategy should show a profit factor above one before any stop or target is added. The useful reframing is that there is no such thing as a raw strategy. A rule with no exit is a bet on the holding period you did not specify — if the backtester closes at the next signal, that is a signal exit; if it closes at the end of the data, that is a very long time exit. So the question is really: does the entry have an edge under the most neutral exit available? That is the time exit, at a horizon that matches the idea. If the answer is yes, a stop can protect the edge and a trailing stop can shape it. If the answer is no, the exit is being asked to create an edge, and that is where the overfitting starts.
The triple-barrier method: all three exits at once
Marcos López de Prado's Advances in Financial Machine Learning (2018) describes the triple-barrier method as a way of labelling outcomes for a model: a trade ends at whichever of three barriers it touches first — an upper barrier (the target), a lower one (the stop), or a vertical one (the time limit). Read as an exit rule, it is simply the honest version of everything above: a stop and a target in volatility units, with a time exit underneath so no trade can sit forever. Each trade's label records which barrier ended it, so the report can tell you whether the strategy's profit comes from targets hit, stops avoided, or time-outs that happened to be up. The meta-labeling guide covers how a second model can then learn which trades to take.
The practical benefit is that the three barriers are designed together, which is how exits should be designed. A target with no time limit and a stop with no target are half-rules, and half-rules are what the optimiser fills in from the past.
A short procedure
- Fix the entry. Run it with time exits at three horizons. Note whether any horizon shows an edge.
- Add a stop in ATR units. Sweep it. Keep only a value on a plateau.
- Decide between a target and a trailing stop based on what the outcome histogram says the entry does — quick reversals want a target, persistent moves want a trail.
- Put a time limit under whatever you chose. Every trade ends.
- Walk it forward. If the exit parameters that win in each window keep changing, the exit is fitting noise.
How this looks in Wise Apple
Wise Apple treats exits as settings rather than an afterthought. Triple-Barrier Labels define the target, stop and time limit together in volatility units; ATR Trailing Stop, Take-Profit Rule and Time Exit are each a control you can sweep, and the walk-forward defaults apply to them the same way they apply to every other parameter. The candle-by-candle trade journal records which exit rule ended each trade — stop loss, trailing stop, take profit — so you can see at a glance whether the result comes from targets, stops or time-outs, and Candle Replay lets you watch a single exit fire bar by bar. It tests one instrument at a time and places no trades.
Questions traders ask about stop losses and exits
Do stop losses improve backtest results?
Sometimes, and it depends on the entry. A stop caps the size of each loss at the cost of more losses, so it helps when the entry's losing trades keep going and hurts when they tend to recover. Test it by holding the entry fixed, running a time exit as the baseline, then sweeping the stop distance in ATR units and looking for a broad plateau rather than a single best value.
What is a time-based exit and why use one?
Closing a trade after a fixed number of bars regardless of price. It is the most honest exit because it has one integer parameter and cannot be tuned to dodge specific past events; it tests only whether the entry predicts the next N bars. It also gets you out of losers that sit, which is why traders who switch to it often see the average loss shrink.
Why do trailing stop backtests look better than live results?
Usually two things. The trailing distance was fitted to the pullbacks of the biggest trend in the data and does not match the next one, and the backtester resolved bars where the stop and a new high were both inside the range optimistically. Sweep the distance out of sample and set the engine to assume the stop is hit first when a bar is ambiguous.
Is a 1:2 risk-reward ratio always right?
No. The ratio sets the break-even win rate — 1:2 needs about 33% winners — but whether the entry can deliver that win rate at that target distance depends on how the instrument moves after the signal. Some entries do better with a wide stop and a quick target, which is a lower ratio and a higher win rate. Read the trade histogram under a time exit and let it tell you the shape.