Thanks for reading. One more thing I should mention: I always validate with different broker settings (spread, commission, and swap) because the same EA can behave completely differently across brokers. It would be great to hear how others handle broker-dependent parameters in their gold EAs.
I use genetic optimization only to locate promising regions, then a smaller full grid around those regions. The best single pass is usually not interesting. I prefer a wide plateau where nearby settings stay profitable with similar drawdown.
After that I repeat OOS tests across several time windows and worsen spread, commission and delay. For gold I would also test another broker’s data, because one broker-specific result can look much more robust than it really is.
Your approach is already much better than optimizing a single historical period. One thing I would add based on my experience is that the number of parameters alone is not a reliable measure of overfitting. Even 3–4 parameters can be overfit if the search is repeated enough.
Between genetic and full-grid optimization, I’d use them for different purposes. Genetic optimization is useful when the search space is large and you want to locate promising regions quickly. Grid search is useful afterward for examining the local parameter landscape and checking whether the result is actually robust.
For XAUUSD, I’d also test the selected settings with small parameter changes around the optimum. If performance collapses when a value moves slightly, that is often a warning sign that the result is too finely fitted.
My validation sequence would be:
Optimization → out-of-sample test → walk-forward test → parameter sensitivity → realistic spread/slippage → Monte Carlo/stress testing.
I’d also test different market regimes separately, because gold can behave very differently during trends, ranges and volatility spikes.
The goal is not to find the best parameter set. It is to find a stable region of parameters that continues to work when the market and execution conditions change.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone,
I wanted to share some lessons learned about parameter optimization, hoping to get your feedback and maybe some ideas to improve.
1. Walk-forward optimization beats simple single-period optimization. A strategy that looks great on one year of history often breaks on the next six months.
2. Use a realistic spread model and slippage. Backtesting gold with a 20-cent spread is very different from the real 35-50 cents you see during London/NY sessions.
3. Avoid overfitting by limiting the number of free parameters. I try to keep each EA to no more than 5-6 meaningful inputs, and I check that the equity curve stays smooth across different starting points of the test period.
4. Out-of-sample validation is essential. I reserve the last 20% of history and never look at it during optimization.
5. Be careful with tick data gaps around rollovers and low-liquidity weekends on XAUUSD.
What do you use in your own workflow? Do you prefer genetic optimization or full grid search? Any tips on avoiding curve-fitting when working with gold specifically?
Best regards