Trading Opinion

Markets · Platforms · Plain Talk

Opinion

Why Your Backtest Is Lying to You

Every trader has had the moment. The equity curve comes back smooth and rising, the drawdown looks survivable, and for about ninety seconds you believe you have found something. Then you trade it and the curve does not look like that at all.

The gap between those two curves is almost never mysterious. It is a handful of specific, boring errors that each shave a few percent off reality, and they compound. Here are the ones that have cost me the most, roughly in order of how much damage they do relative to how easy they are to miss.

QuantConnect homepage describing an algorithmic trading and backtesting platform
Screenshot: QuantConnect homepage, August 2026.

1. You tested the survivors

If your universe is today's index members, you have already broken the test. The companies that went bankrupt, got delisted or were acquired at a discount are not in your data. You are asking how a strategy performed on a list of firms selected, with perfect hindsight, for having survived.

This is worth more than people assume. Any long-biased strategy inherits a tailwind it did not earn, and it inherits it invisibly, because nothing in the output says "the losers were removed before you started". If your data provider offers point-in-time index membership, use it. If it does not, at minimum stop backtesting long-only equity strategies on the current index and calling the result history.

2. You used information you would not have had

Look ahead bias is the one that feels impossible until you find it in your own code. A signal computed on the daily bar's close and then executed at that same close. Fundamentals timestamped to the quarter they describe rather than the date they were published, which can be six weeks later. An adjusted price series that folds in a split announced afterwards.

The test I use is simple and it catches most of it. For every input, ask what time of day it became publicly known, and whether the entry occurs strictly after that moment. If the answer requires any hedging, the strategy is peeking.

3. Costs were an afterthought

Commissions are the easy part and the part everyone remembers. The spread, the slippage and the market impact are where the money actually goes, and most backtests either ignore them or apply a flat figure that flatters the strategy.

Fills are the specific lie. Backtests love to fill at the midpoint. Real orders cross the spread, and they cross it at the worst moments, because the fast markets where your signal fires are also the ones with the widest quotes and the thinnest books. A strategy trading a few times a month can absorb sloppy cost assumptions. One trading intraday cannot, and the higher the frequency the more the entire result is a costs question wearing a strategy costume.

Model it pessimistically. If the edge only exists at optimistic fills, the edge is the fill assumption.

4. You optimised until it worked

Here is the uncomfortable one, because it does not feel like cheating while you do it. You test a 20 period average. Mediocre. You try 15, then 25, then 22. The last one looks great, so that is the strategy now.

What you have done is search a space of parameters for the combination that best fits the noise in one particular sample. With enough attempts something will always look excellent, and the more you tried the less the winner means. Two hundred variants tested and the best one is not a discovery, it is the expected maximum of two hundred random draws.

The diagnostic is fragility. Take your chosen parameters and nudge them. A real edge sits on a plateau, so 20 and 22 and 24 all behave broadly alike. An overfitted one sits on a spike, where 22 is wonderful and 21 and 23 are not. Plot performance across the parameter range and look at the shape. If it is jagged, you found noise.

5. The sample never contained a hard market

A momentum strategy tested from 2013 to 2019 will look like genius. It never met a regime that punished it. Any sample short enough to contain one kind of market is a test of that market, not of the strategy.

Trade count matters more here than calendar span, and people mix the two up. Ten years of a setup that fires twice a month is 240 trades, which is thinner than it sounds once you split it by regime. I want to see the system survive a period it should hate, and I want enough occurrences in that period to believe the survival was not luck.

6. You tested it once, on everything

A single optimisation across your whole history gives you one number and no way to know whether you would have chosen those parameters in advance. Walk forward gives you something closer to an honest answer: fit on a window, test on the untouched window after it, roll forward, repeat.

It is more work and the results are uglier. That is the point. The ugliness is the part that was always there.

What I actually do now

Hold back a slice of history and do not look at it. Not once, not for a peek. Build entirely on the rest, and when you are finished, run the held-out slice a single time. If performance falls apart, you learned something cheaply. If you then go back and tune against that slice, you have burned it and it is no longer a test.

Then trade it small and live for a while before trusting the size. Paper trading skips slippage and skips the part of you that hesitates, and both of those turn out to matter.

A backtest cannot tell you a strategy works. At best it tells you a strategy was not obviously broken in the past, which is a much smaller claim and the only honest one available.

Read next