Glossary · Risk & money

Curve fitting in gold trading

Curve fitting is tuning a gold strategy's rules and settings so tightly to past data that it fits the noise, producing a great backtest that fails on new data.

Also called Overfitting, Over-optimization, Data snooping

Curve fitting, or overfitting, happens when a strategy is adjusted until it matches the quirks of a particular historical period instead of a durable market behavior. The more parameters and filters added, the easier it is to fit the past perfectly and the less likely the result is to repeat.

How it applies to gold trading

Gold’s history contains plenty of unique events: specific Fed meetings, crisis spikes and record runs. An optimizer can always find an RSI period, an ATR multiple and a session filter that profit from those exact moves. The warning signs are many parameters, settings with odd precise values (RSI 17, ATR 2.37), results that collapse when a setting changes slightly, and performance that depends on a handful of trades.

The defenses are simple rules, few parameters, testing on data not used for optimization (out-of-sample), walk-forward analysis and checking that neighboring settings also work.

Worked example

Example (hypothetical numbers): an optimized gold EA shows +85% in 2023 with RSI 17, ATR 2.37 and a 9:40 to 10:55 window. Changing RSI to 16 or 18 drops the result to +5%, and the 2024 out-of-sample test loses 22%. A simpler version with RSI 14, ATR 2 and the London session made +18% in 2023 and +11% in 2024.

A common mistake

Optimizing on all available data and calling it a backtest. Always hold back a period the optimizer never sees.

See also: Backtest, Walk-forward analysis, Sample size, Expert advisor.

Frequently asked questions

How can I tell if a gold strategy is curve fitted?

Look for many parameters, oddly precise settings, results that collapse with small changes and poor performance on data that was not used to build it.

Is optimizing settings always curve fitting?

No. Light optimization of a few parameters, checked on out-of-sample data, is normal. The problem is heavy tuning with no independent test.