How to Optimize an EA Without Curve-Fitting It
Optimisation asks the tester to find the input values that performed best on historical data. The trap is built into the question: the "best" settings are usually the ones that fit that particular stretch of history most tightly - including its noise - and noise does not repeat. That is curve-fitting, and it is the single most reliable way to turn a decent EA into a live loser. Here is how to optimise and keep your honesty.
Why the best backtest is usually a lie
Test enough parameter combinations and one of them will look spectacular by chance alone. The more inputs you tune and the finer the steps, the more certain this becomes. The spectacular result then fails on new data because what it captured was coincidence, not edge. The full mechanics are covered in overfitting and walk-forward explained - and the aftermath in why most EAs fail live.
Rules for honest optimisation
- Split your data before you start. Optimise on one portion (in-sample) and reserve the rest, untouched, for a single final check (out-of-sample testing). If you re-optimise after peeking at the holdout, it is no longer a holdout.
- Limit the free parameters. Every additional tunable input multiplies the ways to fit noise. Tune the two or three that matter; fix the rest at sensible defaults.
- Use coarse steps. Scanning a period from 10 to 50 in steps of 5 is exploration; scanning in steps of 1 is memorisation.
- Choose plateaus, not peaks. Look at neighbouring results. If a setting of 20 is brilliant but 18 and 22 are poor, the 20 is a fluke - pick from regions where a whole range of values performs decently. Robust settings have unremarkable neighbours.
- Judge by robustness, not raw profit. Prefer smoother equity, contained drawdown and consistency across the period over the highest end balance - equity curve analysis shows what to look for.
- Validate walk-forward. Optimise on a window, test on the next, roll forward, repeat. If performance only exists in the optimisation windows, you have your answer. See walk-forward analysis.
- Demand a real sample size. Conclusions from 40 trades are wishes. Hundreds of trades across varied conditions is where evidence starts.
Common mistakes
- Optimising every input the EA exposes. More knobs, more fiction.
- Running optimisation repeatedly until something passes the holdout. That is just overfitting with extra steps - each retry burns the holdout a little more.
- Ignoring costs. Optimise with realistic spread and assume live adds slippage; a thin edge that only survives at zero cost is not an edge.
- Shipping the #1 result from the optimiser's leaderboard. The top row is, almost by definition, the most curve-fit row. Look for the stable neighbourhood instead.
Building the discipline in
All of this is doable by hand in the Strategy Tester - it just requires discipline nobody feels like exercising at 11pm. Nebula was designed around this exact trap: strategies are scored on unseen data as they are built, unstable configurations are culled automatically, and what exports is a standard MT4/MT5 EA that earned its settings rather than memorising them.
Trading carries a high level of risk. Nothing here is financial advice; past performance does not predict future results.
Want the whole system, not just the tool?
76 complete trading systems, each tested on data it never saw, from £9.99. Buy 3 and save 15%.
Start free. Deploy one system.
See pricing › Or browse the ready made Systems Library ›
Download Nebula free · What Nebula does · Funded and prop firm traders · Free trading tools · Reviews · Discord · YouTube · About · Contact
- Free tier, no card: build, test and make one real deploy before you pay anything
- Runs on your own PC or Mac: your MT4/MT5 account stays with your broker
- 14-day cooling-off on any purchase before activation, in line with UK consumer law
- A real person answers: Ross, the founder, via contact or Discord
- Real reviews · Nebula on Trustpilot
Reviews on Trustpilot: Nebula & tools (Orion RFX) · private mentoring (Pip Surfing Society)
Watch AI trade, right on your phone.
In NESAB, five AI models run nine simulated portfolios on live prices. Every decision is logged with its reason. Follow one or all of them.
ROSS20Use the code when you subscribe after the free 3 day trial.
Why we partnered ›NESAB portfolios are simulated. Past or simulated performance does not guarantee future results.