The one-sentence definition
Overfitting is tuning a strategy's rules so tightly to historical data that it captures that period's random noise rather than a real, repeatable pattern - making the backtest look great and the live results disappoint.
Why it happens
Every price history contains a mix of genuine patterns and pure randomness. If you keep adjusting a rule - this exact dip size, that exact holding period, these specific thresholds - until the equity curve looks beautiful, you're often fitting the randomness. It won't repeat, because noise by definition doesn't.
The more knobs a strategy has and the harder you turn them to maximise past performance, the more likely the result is a mirage.
A worked example
Imagine you test a rule and find that 'buy when bitcoin falls exactly 7.3% in a day and sell after exactly 11 days' produced a spectacular backtest. That oddly specific 7.3% and 11 days should make you suspicious.
Now test the neighbours: 6% and 8% dips, 9 and 13 day holds. If the strategy is real, those nearby settings should also work, roughly. If only 7.3%/11-days works and everything around it falls apart, you didn't find an edge - you found the one combination that happened to fit the past's noise.
How to avoid it
Practical defences against fooling yourself:
- Prefer simple rules with few parameters - fewer knobs, less room to overfit.
- Test the neighbours. A robust edge keeps working as you nudge each setting; a fragile one only works at one exact value.
- Test across different market conditions - a bull run, a crash, a flat stretch - not one lucky regime.
- Hold out data the strategy never saw during tuning, and check it works there too.
- Be suspicious of oddly specific numbers and of any result that seems too good to be true.
Why it matters for backtesting
Overfitting is the number-one reason a strategy that crushed it in testing loses money live. Understanding it changes how you read every backtest: you stop asking 'how big is the return?' and start asking 'how robust is this to small changes?'
A modest, stable result you can reproduce across conditions is worth far more than a dazzling one balanced on a single perfect setting.