Backtest Overfitting
— Why a Strategy That Was Perfect in the Past Falls Apart
You see a backtest result like "400% return over the last 3 years." But run it for real and the performance is completely different. That's because explaining the past well and predicting the future are two different things.
What Overfitting Is
It's a state where a rule has been tuned to fit historical data too precisely.
Think of it like studying for an exam by memorizing the answers to past exam questions outright. You'd get a perfect score on that exact test, but you couldn't solve a new question. Data mixes together genuine regularity and randomness unique to that particular stretch, and fitting too finely ends up learning the randomness too.
How It Happens — the Common Path
- You build a strategy and run it on historical data. The result is mediocre.
- You tweak a parameter slightly. RSI 30 → 28. Returns go up.
- You add a condition. "Only when volume is 2x or more." It goes up more.
- You adjust the stop-loss width. It goes up again.
- The finished strategy's historical return is excellent.
The problem is steps 2 through 4. You looked at the result and changed the rule. From that moment on, the backtest stops being verification and becomes a fitting exercise. The more attempts you make, the more chances you get for something to look good purely by luck (see multiple testing).
In-Sample and Out-of-Sample
- In-sample — the data you looked at while building the rule. Performance here can always be made to look good, so it isn't evidence.
- Out-of-sample — data you're seeing for the first time after the rule is locked in. Performance here is the real thing.
But out-of-sample data also gets contaminated if you look at it more than once. Repeating "that didn't fit, let me tweak the rule and try again" eventually turns that stretch into in-sample data too. It only means something if you use it exactly once.
The Most Reliable Verification — Forward Testing
Lock in the rule publicly first, then confirm it against data that arrives afterward. Since data that doesn't exist yet can't be fitted to, self-deception becomes impossible.
This is why DawnScan logs a new signal at a weight of 0 only, and decides whether to fold it in only after a sample has built up. The measurement standard gets set first, and whether the data clears that bar gets checked afterward.
- The decision criteria (minimum sample size, confidence interval, correction) get locked in in advance.
- If it falls short, it's held back, not passed by lowering the bar.
- Held-back signals and the reason are published too.
What to Ask When Looking at a Backtest Result
- How many times was a parameter adjusted? — the more times, the more chance is mixed in.
- Is there performance from after the rule was locked in? — if not, it hasn't actually been verified yet.
- Did it account for trading costs and slippage? — for a small-cap strategy, this alone can flip the result.
- Did it include delisted stocks? — excluding them inflates the return.