Concept
Overfitting and Curve Fitting
Overfitting is tuning a strategy so closely to historical data that it captures the noise in that particular sample rather than any durable relationship. Performance on the data used for tuning systematically overstates what follows.
How to read it
- Every parameter tested adds opportunity to fit noise. Searching many combinations for the best result finds the one that suited that history, not the one that generalises.
- It happens without intent. Trying settings, keeping what tested well and discarding what did not is itself a search over the same data.
- Out-of-sample testing — holding back data not used during development — is the standard check, and results there are usually markedly worse.
How it happens by accident
A trader tests a moving-average crossover on five years of index data. The 9/21 pair performs modestly, so they try 8/21, 10/24, 12/26 and about forty other combinations. The 11/29 pair produces a substantially better result and is selected. Nothing dishonest occurred, but forty tests on one dataset will produce a standout by chance alone, and the selected pair carries that luck in its result. Deployed forward, it typically performs closer to the average of all combinations tested than to the best one. This is why reported backtest performance and live performance diverge so reliably.
What it does not tell you
- Out-of-sample testing loses value once the held-back data has been examined repeatedly, because it has effectively become in-sample.
- The more elaborate the rule set, the more scope for fitting noise. Simple rules with few parameters are harder to overfit but not immune.
- It cannot be eliminated. Any strategy developed by looking at history carries some of it.
Frequently asked questions
What is overfitting in trading?
Tuning a strategy so closely to a historical sample that it captures that sample’s noise. Performance on the tuning data overstates what happens afterwards.
How do I avoid overfitting?
Test fewer parameter combinations, prefer simpler rules, and hold back data not used during development. None of these eliminates it — they reduce how much of it you carry.
Why does my backtest look better than live results?
Commonly a combination of overfitting, unmodelled costs and slippage, and the fact that the backtest assumes fills that live trading does not deliver.
Is optimisation always bad?
Adjusting parameters is not inherently wrong. The problem is selecting the best result from many tests on one dataset and expecting that result to persist, because the selection itself favours whatever was luckiest.
Related
- Expectancy and Win Rate — Concept
- Moving Average Crossover: How It Works — Strategy
- Drawdown — Concept
Educational use only
This page is educational material about how a technical tool is calculated and read. It is not investment advice, not a recommendation to buy or sell anything, and not a signal service. No indicator predicts future prices. CernoQuant is a trading journal and analytics platform, not a SEBI-registered investment adviser. Trading decisions and their outcomes are yours alone.
Indicators describe the market. A journal describes you.
Knowing how RSI is calculated is the easy part. The harder question is whether you actually followed your own rules — CernoQuant reads your executed trades and measures the gap between what you intended and what you did.
See your own patterns →