Trading Education
What Is Curve Fitting and Why Is It Dangerous for Traders?
Learn what curve fitting means in trading, why it makes backtests look incredible but live trading fail, and how to avoid overfitting your strategy.
Source updated
- Originally published
- Source updated
In this article
In strategy research, overfitting means selecting rules that explain quirks of the development sample more convincingly than they generalize to new observations. Traders often call this curve fitting. A strategy need not match history perfectly to be overfit.
The Search Creates the Problem
Imagine testing 200 moving-average combinations and reporting only the most profitable. Even if none has a durable advantage, one can look attractive in that particular sample. Changing filters, markets, dates and stop distances adds more selection opportunities, including choices made manually while looking at charts.
The winning parameter set is not automatically invalid. The concern is that its reported performance benefited from being chosen using the same results you now present as evidence.
Keep a Research Ledger
Record the hypothesis, development data, parameter choices and every tested variation. Keep the final test period separate. Once you inspect that period and tune the strategy in response, it has become part of development; calling it out-of-sample again does not restore independence.
A walk-forward process can model repeated development and later evaluation, but its window lengths and selection rules also need to be fixed and documented. Repeatedly changing the process until its combined result looks good reintroduces the same problem.
Challenge Nearby Choices
Check whether small changes in parameters, costs or entry timing destroy the result. A narrow isolated optimum deserves investigation. Test additional periods relevant to the intended market and report failures as well as successes.
A strategy designed for one market need not work in every other market. Likewise, there is no universal number of parameters beyond which a model is certainly overfit. Complexity, sample information, the number of trials and the validation design all matter.
Separate Overfitting from Other Errors
A backtest can fail for reasons besides selection: future information, incorrect corporate-action adjustments, unrealistic fills or omitted costs. TradingView documents strategy-testing pitfalls, including lookahead bias and overfitting. Investigate these separately rather than giving every live discrepancy the same label.
AI does not remove the need for this process. A model that searches many candidate patterns still needs a controlled evaluation. An impressive chart is the beginning of the audit, not its conclusion.
Risk Disclaimer: Trading involves substantial risk of loss. Past performance is not indicative of future results. See our full risk disclaimer.