Glossary
What is curve fitting?
Curve fitting is adjusting a strategy's rules or inputs until its backtest equity curve looks good on the data at hand. In trading, it is another name for overfitting.
The name comes from the equity curve, the account value over time: nudge an input, nudge another, stop when the curve climbs smoothly. Each nudge is a trial, and the curve you stop at is the one that fitted this stretch of history best, partly by luck.
The giveaway is fragility. A curve-fitted setting often sits on a narrow peak: move an input one step and the result drops sharply. A setting in the middle of a broad plateau, where neighbouring settings do about as well, does not depend on one exact value – and it still needs a test on data it did not see.
In practice
In our parameter optimization guide, the top cell of a 2,000-run sweep made +11.27% and dropped to +3.34% one step to the side and to +2.58% two steps away, while a block of 44 adjacent cells all landed between +4.4% and +8.4%.
Simulated results on historical market data. Past performance is not indicative of future results. Not investment advice.
Related terms
Read more
- Pine Script Parameter Optimization: A Grid-Search Guide
- What 2,000 Pine Script backtests taught us about overfitting
Topic: Overfitting
Part of the guide: Overfitting and luck