What is curve fitting in trading?
In one line: Curve fitting is adjusting a strategy's rules or settings to match past price data as closely as possible, often making it look better than it really is.
The idea
Every strategy has settings. Stop distance. A moving average length. A time window.
Curve fitting is turning those dials until the past results look as good as possible. A little is normal. Too much becomes overfitting.
A simple example
You test a breakout rule on 2 years of data with 3 settings:
- Stop distance: 10 options.
- Target size: 10 options.
- Time of day: 10 options.
That's 10 × 10 × 10 = 1,000 combinations. Run them all and some will look great by pure chance.
Say the best one shows +60R. The middle of the pack shows about 0R. The best one is probably the luckiest, not the smartest. A math example, not a promise.
Light tuning vs heavy fitting
| Light tuning | Heavy fitting |
|---|---|
| 1–3 settings | Many settings and filters |
| Picks a value from a wide, steady range | Picks one exact "best" value |
| Nearby values give similar results | Nearby values give very different results |
| Checked on unseen data | Only checked on the data it was tuned on |
Why it matters
A heavily fit strategy is tuned to yesterday's market. When the market shifts, the results often fade.
The more combinations you try, the more likely your "best" result is luck. That's why fewer rules usually test more honestly.
A common mistake
Picking the single best setting. Look for a plateau instead: a range where many nearby values all do reasonably well. If moving a setting by 1 or 2 flips a winner into a loser, it isn't real. Then test the plateau on new data with walk-forward testing.
Write down how many combinations you tried. If it's hundreds, treat the best result with a lot of doubt.
More in how to backtest a trading strategy.
Questions
Is curve fitting always bad?
No. Choosing sensible settings is part of building any strategy. It becomes a problem when you tune so tightly that the strategy only fits the past.
How do you avoid curve fitting?
Use few settings, prefer wide ranges where results are steady, and always test on data the strategy wasn't tuned on.
What's the difference between curve fitting and overfitting?
Curve fitting is the tuning. Overfitting is what you get when the tuning has learned noise instead of a lasting pattern.
Want the next step? We'll walk you through it.
Four free lessons by email, one every few days — each with a 10-minute exercise on a real chart.
Send Me the Free Lessons 4 short emails · No spam · Unsubscribe anytimeOr see the whole method, step by step:
See What’s Inside the Course Try everything free first. Decide when you're ready. · Open the free chart tool (works in the TradingView phone app)One chart idea a day, in plain English. Follow along: