Quant Invest System

Why one good backtest proves little

A backtest answers the question “how would these rules have done on this data?”. It does not answer “will they keep working?”. The gap between the two is mostly about how many other rules were tried before these were kept.

The best of many tries is biased upwards

Suppose you test a hundred variants of an idea: different moving-average lengths, stop distances, session filters. Even if none of them has any edge, their results will spread out by chance, and the best one will look good. Keep only that one, and its backtest is no longer a fair estimate of anything. It is the maximum of a hundred noisy numbers.

This is the core of what is usually called overfitting or curve fitting. It does not need many parameters. Three parameters, each tried at ten values, is already a thousand backtests. Bailey and López de Prado show that the expected best Sharpe ratio among many trials with no true edge rises with the number of trials, and they use it to correct the reported one (the deflated Sharpe ratio, 2014). Bailey, Borwein, López de Prado and Zhu (2014) show how few trials it takes to find an impressive backtest on a short history by chance.

Academic finance has the same problem with published factors. Harvey, Liu and Zhu (2016) argue that, given how many factors have been tried, a new one should clear a t-statistic of about 3 rather than the usual 2.

What to ask of a backtest

  • How many variants were tried? If the answer is unknown, assume many. A result that would be convincing as a single test may be ordinary as the best of a search.
  • How many trades, not how many years? Ten years with forty trades is forty observations. The uncertainty of an average shrinks with the number of trades.
  • Which costs? Spread, commission, slippage and swap, stated per trade. A strategy whose average trade is close to its cost is fragile even if the backtest is right.
  • Was any period left untouched? Data that was never used to choose rules or parameters is the only part of a backtest that can surprise you. A period that was looked at, even once, during development, no longer counts.
  • Do neighbouring settings also work? If moving a parameter one step makes the result collapse, the chosen value was probably fitted to noise.
  • Are the trades independent? Many positions open at once, or grid and martingale logic, make the effective number of trades smaller than the count in the report.

What a held-out period can and cannot do

A held-out period is a good test of whether the result fell apart, but a weak test of whether it is real. It is usually short, so it has few trades, so only a large drop can be detected. It is also used only once: after you have seen it, it becomes part of the history you fitted to. That is why our backtests hold out the last 20% of the window, report the smallest drop the check could detect, and call the result indicative when the held-out period is too short to say much.

A textbook rule on prices with no edge

Our sample report runs a Donchian channel breakout, a rule from the textbooks, on eight years of synthetic four-hour prices: a random walk with no drift, so there is nothing to find. With costs, in the first 80% of the window it made 316 trades with a profit factor of 0.85, and the probability that its true per-trade Sharpe ratio is above zero comes out at 0.205. The verdict is No evidence of edge. That is the first thing to ask of any test: on data where no edge exists, it should not report one.

We apply the same rules to our own strategies and publish how many survive in the research log. Most do not.

What this means for a report you send us

A Report Audit looks at a test you ran yourself. We cannot see how many variants you tried, so the report states that limit instead of guessing. What it can do is tell you whether the number of trades is enough for the result to be told apart from chance at all. The methodology page lists every rule.

Sources

  • Bailey, D. H. and López de Prado, M. (2014). The Deflated Sharpe Ratio: Correcting for Selection Bias, Backtest Overfitting and Non-Normality. Journal of Portfolio Management, 40(5).
  • Bailey, D. H., Borwein, J. M., López de Prado, M. and Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5).
  • Harvey, C. R., Liu, Y. and Zhu, H. (2016). … and the Cross-Section of Expected Returns. Review of Financial Studies, 29(1).