Backtesting Without Stops
Why I test a strategy with only a timed exit first, and how that leads to a better stop
When I build a strategy, one of the first backtests I run has no stop loss and no profit target. Every trade gets the same entry it always would, and then it's held until a timed exit: the end of the day, after a set number of minutes, or after a set number of days.
That doesn't mean I trade without a stop. Every strategy I trade has one. Backtesting without a stop is how I find out whether the entry is any good, how I keep the optimization honest, and how I choose the stop.
What the Backtest Looks Like
- Same entry as the strategy you plan to trade.
- No stop and no target. The only exit is the timed exit.
- Maximum adverse excursion (MAE) in the trade list. AmiBroker's trade list has an MAE column by default. Include MFE too if your platform has it.
- Position sizing as if the stop were there. If your strategy sizes each trade from the distance to its stop (risk a fixed amount per trade), keep calculating the size that way. Just don't exit when the stop price is hit. That keeps a stock with a wide range from getting the same share count as a stock that barely moves.
It helps to make the stop a parameter in your backtest code, with a setting that sizes from the stop but doesn't enforce it. Then you can switch between the two backtests without editing code.
Reason 1: Is the Signal Any Good?
An entry should work on its own, without help from a stop or a target. If trades held to the timed exit don't make money, the entry probably doesn't predict much.
A tight stop can hide that. It cuts every loser short and lets the occasional winner run, so even a close-to-random entry can look profitable in a backtest. Trading it is another story: the stop gets hit more often than the backtest says, because spreads and normal wiggles take you out before the price the backtest used.
Running the backtest without a stop is the smoke test. If the edge is there without the stop, you have something to build on.
Reason 2: A Stop Makes Different Trades Look the Same
Picture two long trades from a strategy that holds all day. Both hit the stop early and lose the same amount.
- The first one turns around after the stop and closes the day with a strong profit.
- The second one keeps falling and closes the day with a large loss.
With a stop in the backtest, those two trades are identical: the same loss. Without the stop, one is a big winner and the other is a big loser.
That matters when you optimize. The Strategy Cruncher looks for rules that separate your good trades from your bad ones. In a backtest without stops, it can reward rules that keep trades like the first one and penalize rules that keep trades like the second. With the stop in place, it can't tell them apart.
A good way to see this in your own strategy: run the backtest both ways, with the same trades in each, and look at the trades whose profit changed the most. You'll find trades like both of these, and you'll usually learn something about the strategy you can use.
Reason 3: Choosing the Stop
Ironically, the best way to choose a stop is from a backtest that doesn't have one.
Maximum adverse excursion (MAE) is the worst point a trade reached while it was open: how far it went against you before it exited. Buy at $10, drop to $9.40, then exit at $10.50, and the MAE is $0.60 a share.
With every trade's MAE, you can work out what any stop would have done without running the backtest again. A trade whose MAE is bigger than the stop would have been stopped out; any other trade plays out exactly as it did. One backtest answers what would otherwise take dozens of guess-and-check runs.
The Strategy Cruncher does this for you. When your trade list includes MAE, the report ends with a Stop Analysis chart. For a range of stop levels, from tight to loose, it shows:
- How often the stop is hit. Very high at the tight end, falling as the stop widens.
- Win rate. Lower with a tight stop, since more trades get stopped out.
- Total profit.
- Largest drawdown.
Reading the Stop Analysis
There isn't one right answer, and the level with the most total profit usually isn't it.
- No stop at all often looks best on total profit. That's normal for a good strategy. Every stop should cost you some profit in the backtest. If adding a stop makes a strategy much better, the entry may be leaning on the stop (see Reason 1).
- Be skeptical of the tight end. The tighter the stop, the more slippage, spread and noise matter, and the backtest sees none of them. A strategy stopped out 60% of the time on paper may be stopped out far more often live.
- Think about how it will feel. A stop that's hit most of the time is very hard to trade, even when the numbers say it's fine.
- Think about size. If you size from the stop, a tighter stop means more shares per trade. A wider stop means smaller positions but fewer stop-outs. Smaller drawdowns, even at some cost in total profit, are what let you trade a strategy at size.
Choose a level that works across the whole set of trades, not one that fixes the last few trades that annoyed you.
Then the Target
MFE (maximum favorable excursion) is the best point a trade reached. It's tempting to choose a stop from MAE and a target from MFE using the same backtest, but you can't: neither number says when it happened, so you don't know whether a trade would have hit the stop or the target first.
Choose the stop first. Then run the backtest again with that stop in place, and use the MFE from that backtest to decide on a target, if you want one.
Bonus: Compare the Two Reports
Once you've chosen a stop, crunch the backtest with the stop as well as the one without, and compare the two reports.
- A filter that shows up in both, at roughly the same value, holds up whether or not the stop is there. That's a good sign it really predicts something.
- A filter that shows up in only one, or at a very different value, is a question worth answering. The answer might lead you to prefer one rule over another, use a wider stop, or find a second strategy.
This isn't needed for every strategy, but it's most useful where MAE is large, like shorting low-float stocks, where a wide stop is what works.
There's no settled answer to whether you should optimize first and then choose the stop, or choose the stop first. Doing it both ways and seeing whether you end up in the same place is one way to find out.
Watch Out for Outliers
Without a stop, nothing caps a trade's loss, so a handful of extreme trades can swing the whole backtest. I've seen a single trade flip a strategy's edge from long to short. The Strategy Cruncher will find rules that keep or drop those few trades, which isn't an edge.
- Sort the trade list by Profit, Shares and Position value, both ways, and look for trades far out of line with the rest. Sizing from the stop distance can produce very large share counts when the stop is close to the entry.
- Consider a disaster stop well beyond any stop you'd trade. It only cuts off the extreme outliers and leaves everything else alone.
- The Strategy Cruncher warns you at the top of the report when one trade's loss is out of proportion to the total loss, or its position value is far above the rest.
Why I Still Trade With a Stop
If no stop has the most profit in the backtest, why not trade without one?
- A backtest is a limited window. It can't contain everything the market will do. A stop protects you from the move your backtest has never seen.
- A stop is what you size from. It lets you risk a known amount on each trade.
- The swings are hard to live with. Without a stop, the worst trades are very large. Imagine having a few of them in a row after you've built up your size. Most people can't keep trading through that, and a strategy you stop trading makes nothing.
A stop is the price you pay to make a strategy something a person can actually trade. Backtesting without one first is how you keep that price as low as possible.