Backtest overfitting: how to spot it and avoid it
You spot backtest overfitting with one quick test: move each key setting 10% and run the backtest again; if the results collapse, it is overfit. You avoid it by fixing the rules, the data and the number of tries before testing.
If you build strategies, count every version you test. If you invest in them, ask how many versions came before the one you are shown.
An overfit backtest only gives itself away with real money, which is why we want at least 24 months of live trading before we trust a strategy.
- What is backtest overfitting?
- Why is overfitting so common in trading strategies?
- How can you tell if a backtest is overfit?
- Can you measure the probability of backtest overfitting?
- How do you avoid overfitting when you build a strategy?
- What should you ask a manager before trusting a backtest?
- Backtest overfitting questions traders and investors ask
What is backtest overfitting?
Backtest overfitting means a trading strategy has been tuned until it fits the random ups and downs of past prices, so its backtest, a test of the rules on historical data, looks far better than the strategy will trade.
Every rule has settings, called parameters: how many days of prices a signal looks back over, or how far below the entry price a losing trade is closed. Each setting a developer can adjust in the backtesting process is one more way to make the past look good, and with enough of them almost any price history can be fitted.
Why is overfitting so common in trading strategies?
Overfitting is common in trading strategies because testing is cheap and every extra version raises the odds that one looks good by luck. A computer can try thousands of versions on the same price history, and usually only the best one is shown to anyone.
Ten years of daily prices are about 2,500 trading days, but a slow trend following strategy, which buys what is rising and sells what is falling, may only trade a few dozen times in that period, and each trade is one piece of evidence.
- In August 2026, researchers re-tested trading strategies that had looked strong on a few stocks over a few months, this time on more than 100 stocks from 2000 to 2024, and the advantages reported earlier shrank sharply. The strategies were built on AI language models
- The Sharpe ratio measures return per unit of risk. In May 2014, four mathematicians showed that with five years of data, trying more than about 45 different versions of a strategy almost guarantees one with a yearly backtest Sharpe ratio of 1, a good-looking result, while its expected Sharpe ratio on new data is zero, no skill at all
- In 2016, Harvey, Liu and Zhu argued that because hundreds of factors had been tested on the same stock data, a new investing factor, a trait such as cheapness said to predict stock returns, should pass a stricter luck test: a t-ratio of 3.0 instead of the usual 2.0, where a higher t-ratio means the result is less likely to be luck
How can you tell if a backtest is overfit?
You can tell a backtest is overfit when small changes break it: the results collapse if a setting moves slightly, or the strategy only works on one market or one period. A sound strategy only gets a little worse under these changes.
These are the checks we ask to see for any backtest:
| Check | Overfit backtest | Sound backtest |
|---|---|---|
| Each key setting moved by 10% | Results collapse or turn negative | Results slip a little |
| Losing periods | Almost none, through every sell-off in the data | Some, in the markets the strategy is known to struggle in |
| Rules and filters | Many, each added after a bad stretch | A few, each with a reason behind it |
| Other markets and years | Works on one market and one stretch of years | Still works, more weakly, on related markets |
| Versions tested | Unknown, or nobody kept count | Counted and written down |
| Live record | None, or far weaker than the backtest | In line with the backtest after trading costs |
When looking at profits, you don’t want a strategy to make more than three to four percent a month on the account. The risk gets way too high, and in a backtest it most often means too much tuning.
Can you measure the probability of backtest overfitting?
Yes, the probability of backtest overfitting (PBO) can be measured, but only with the results of every version tried: split the history into pieces, pick the best version on some and rank it on the rest. PBO is how often that winner ends up in the bottom half.
The method comes from the same four researchers, who published the probability of backtest overfitting in the Journal of Computational Finance. A PBO of 50% means choosing the best backtest did no better than choosing one at random.
Every version that was thrown away counts too, so a developer can calculate PBO and an investor who only sees the final backtest cannot. The related deflated Sharpe ratio, which marks a result down for the number of versions tried, is explained in our guide to out-of-sample testing, the test on data held back from the build.
How do you avoid overfitting when you build a strategy?
You avoid overfitting by deciding the rules, the test data and the number of versions you will try before the first test, and by keeping the number of settings small. Then test the finished strategy once on data you held back, and trade it small before you trust it.
Start with a clean backtest, and choose a relevant time period. Clean means real trading costs, no information from after each trade, and no stocks quietly left out because they went bust. Then:
- Write down why the idea should work before you test it. There must be some sort of good logic behind every rule.
- Keep the settings few. A filter added only to remove one bad stretch of results fixes that stretch and nothing else.
- Log every version you try, including the failures.
- Move every key setting 10% up and down, and check that the results change gently.
- Test on related markets and on years with a sharp sell-off.
A backtest that passes every check above still has to prove itself with real money: start with a few hundred euros and give it at least nine months, so it lives through a change in market conditions. Wait for 24 months of live results before you put in more.
What should you ask a manager before trusting a backtest?
Before trusting a manager’s backtest, ask how many versions were tested before this one, what happens when each key setting moves by 10%, and how the live record compares with the backtest. A manager who answers with numbers has most often tested properly.
A story that is just too good to be true, that’s not the one we want to hear. We also ask:
- which part of the data was held back, and when was it fixed
- which years were hard for the strategy, and why
The SEC’s investor bulletin on performance claims (September 2022) gives private investors the same advice: back-tested performance is hypothetical, so ask what the real performance was.
Backtest overfitting questions traders and investors ask
Overfitting and curve fitting describe the same problem: rules shaped so closely to past prices that they only describe that history. Curve fitting is the traders’ word, from the equity curve, the line of account value over time; overfitting is the statisticians’ word.
Either way, count the versions tested and move the settings to see whether the results hold.
Yes, a long backtest can still be overfit, because a long history does not protect against trying too many versions. What counts is how many versions were tested compared with how much data there is, and a strategy with many settings needs far more history than one with two.
No, overfitting and look-ahead bias are different mistakes. Look-ahead bias means the backtest used information not yet available at the time, such as a day’s closing price for a trade made earlier that day. Overfitting uses only past data but tunes the rules to its random moves.
Ask which algo and quant strategies passed our review
When we review a strategy, we check whether its results hold when the settings move, whether it was tested on held-back data, and whether the live record matches the backtest. There are 25 metrics in total, and our scoring methodology for algo and quant strategies explains how we score them.
We ask for the version count and the held-back data, and we look for at least 24 months of live trading. Only the few strategies that survive this check are listed in the Algotrader.ch Review, such as a quantitative gold strategy, and nobody pays us for a place in it.