Backtesting pitfalls that make a strategy look better than it is

A backtest runs your trading rules over past prices to see how they would have done. It's a useful filter for bad ideas. It is also easy to build a test that looks brilliant and then loses money live, usually for one of the five reasons below. MotiveWave PRO and cTrader both include strategy backtesting, but the pitfalls are the same in any tool, a spreadsheet included.

1. Look-ahead bias

This happens when a rule uses information that wasn't available at the time of the trade. A classic case is buying at the open based on that day's closing price. Go through every condition and ask: could I have known this at the moment of entry? Many platforms let you choose whether orders fill on the signal bar or the next one. Pick the next bar unless you have a clear reason not to.

2. Overfitting the settings

Optimization tools can test thousands of parameter combinations in minutes, and cTrader runs parameter optimization on its cBots. The best combination on past data is often the one that fits the noise. Red flags include oddly specific settings, such as a 17-period average that beats 15 and 20 by a wide margin, and results that collapse when you nudge a setting by one or two steps. Prefer settings that work across a broad range, even if the peak result is lower.

3. Ignoring costs and slippage

Commissions, spreads and slippage turn many winning tests into losing systems, especially on short timeframes with frequent trades. On broker-supplied platforms such as cTrader, the spread and commission depend on the broker, so plug in your own broker's figures rather than a default. Futures traders should add exchange and clearing fees for each side of the trade. A strategy that earns a few ticks per trade needs these numbers to be exact.

4. Testing on too little data

A strategy that made 25 trades over six months hasn't proven much. Aim for hundreds of trades across different conditions: a rising market, a falling one and a long sideways stretch. Longer history helps here. StockCharts PRO, for one, includes historical data back to 1900 for chart studies, which lets you see how a pattern behaved through several cycles.

5. Survivorship bias

If you test a stock strategy only on companies listed today, you leave out the ones that were delisted or went bankrupt. Results look better than they should, because the losers have quietly dropped out of the sample. Ask your data provider whether delisted symbols are included. If they aren't, treat the results as an upper limit. The effect is largest for small-cap and TSX-V strategies, where companies disappear from the list more often.

A routine that holds up

Split your history in two. Build and tune the rules on the first part, then run them once on the second part without changing anything. If the second set of results is much worse, the strategy probably won't survive live trading. Write the rules down before you look at the second half; it's tempting to adjust them after.

Next, paper trade the strategy for a month or two before risking money. Our paper trading guide covers how to make that practice count. Keep a log of every live trade alongside the backtest's expectations, and stop to review if the two drift apart.

A backtest describes the past. It can't tell you what the market will do next, and even a carefully tested strategy can lose money. For help picking a platform with testing tools, see our platform rankings.

Risk warning. Trading stocks, options, futures, forex or crypto carries a high risk of losing money, and leveraged products can cost you more than you deposit. TickerBench reviews software only. Nothing on this site is investment advice or a recommendation to buy or sell anything, so consider speaking with a registered adviser before you trade.