Backtesting is supposed to tell you whether a strategy works before you risk real money on it. Done well, it saves you months of losses. Done badly, it does something worse than nothing: it gives you confidence in a strategy that was never going to work.
The difference usually isn’t the strategy. It’s how honest the test is. Here’s how I backtest, and the ways I see traders fool themselves.
Why I don’t backtest manually
A lot of traders backtest by scrolling back on a chart, often on TradingView, and marking where they would have entered and exited. I understand the appeal. It’s free and easy. But I avoid it, for three reasons.
It ignores real trading costs. A chart replay doesn’t account for slippage, the spread widening around news, or the gap between the price you see and the price you’d actually get filled at. Those costs can turn a strategy that looks profitable into one that loses money.
You miss trades. When you’re scrolling through months of charts by eye, it’s easy to skip a setup without noticing. Usually it’s a losing one, because losers are less memorable. Miss enough of them and your results look far better than reality.
Hindsight leaks in. When you can see what happened next, it’s very hard not to be influenced by it, even slightly. You’ll find a reason a losing setup “didn’t really count.”
Manual review still has value for learning to read charts. But as a test of whether a strategy makes money, it’s too easy to fool yourself.
How I backtest: MetaTrader’s Strategy Tester
I use the Strategy Tester built into MetaTrader. It runs a strategy, coded as an Expert Advisor (EA), through historical price data and records every trade it would have taken, using the broker’s spreads and tick data. No skipped trades, and no hindsight.
Optimization, where the tester runs the strategy many times with different settings, is heavy work. I run it on Windows machines with powerful processors, because testing hundreds or thousands of setting combinations on detailed tick data takes serious computing power.
Here’s my process:
- Take the last six months of data. Recent enough to reflect current market behaviour, long enough to include different conditions.
- Optimize a few settings, not dozens. The more settings you optimize, the easier it is to find a combination that just happens to fit the past.
- Rank results by drawdown, not just profit. I’m looking for the settings with the most manageable drawdown. A strategy that makes a bit less but never digs a deep hole is one you can actually stick with. Our article on risk-reward vs win rate explains why drawdown matters more than a headline number.
- Switch to visual mode and watch it trade. This step gets skipped by most people, and it’s the most valuable. Visual mode replays the test on a chart so you can watch every entry and exit as it happens.
Why visual mode matters
A results report gives you numbers. Visual mode shows you behaviour. When you watch an EA trade the past, you start to see things like:
- Which market conditions it handles well, and which ones it struggles in
- Whether its losses come in clusters, and what was happening when they did
- Whether it trades through major news, and what that does to it
- When you would have wanted to switch it off
That last point is important. Very likely, you’ll see periods where a person needs to step in: disable the EA ahead of a central bank decision, or turn it off in a market it isn’t built for. Watching the past teaches you when to enable or disable it in the future. That’s knowledge no report can give you.
The ways traders fool themselves
The biggest problem with backtesting isn’t the software. It’s what people want from it.
Most traders go into a backtest looking for a winner. They’re hoping what they have is the holy grail, the thing that will let them stop putting in work. That hope is exactly when the mistakes happen:
- Over-optimizing. Tweaking settings until the past looks perfect. The result fits history beautifully and fails on new data. This is called curve-fitting.
- Testing too short a period. A strategy that works for one month may simply have caught one kind of market.
- Ignoring drawdown. A great final profit can hide a drawdown that would have made you quit halfway through.
- Using unrealistic costs. Zero or tiny spreads, no commission, no slippage.
- Changing the rules after seeing results, then testing again on the same data.
A simple check against curve-fitting
One habit protects you from most of these: test on data the strategy hasn’t seen.
- Optimize on one period, say the last six months.
- Then run the chosen settings, without changing them, on a different period the optimization never touched.
- If results collapse on the new data, the strategy was fitted to the past, not built on something real.
After that, run it on a demo account in real time for a few weeks, called a forward test. That shows you how it behaves with live spreads and fills. Only then consider real money, and start small.
Not trading with an EA?
You can still use the Strategy Tester. If your rules are clear enough to write down, they can usually be coded as a simple EA, even if you’d trade them manually in practice. And if your rules are too vague to code, that’s useful information too: a strategy you can’t define precisely is hard to test and hard to follow. A detailed trading journal then becomes your ongoing live test.
The bottom line
Backtesting is only useful if it’s honest. Use a proper tester that accounts for spreads and doesn’t skip trades. Optimize a few settings for drawdown, not just profit. Watch the strategy trade in visual mode so you learn when it needs a human. Test on data it hasn’t seen, then forward test on demo. And go in looking for the truth about your strategy, not for a holy grail. As we cover in trading psychology, the hope of an easy answer is usually what costs traders the most.
Disclosure: The author, Mike Harding, founded Academy of Financial Markets in Toronto and teaches its mentorship program. Past performance, including backtested results, does not guarantee future results. This article is educational and is not financial advice. Trading carries a high level of risk.
