Backtesting separates guessing from knowing. But bad backtesting is worse than no backtesting — it gives you false confidence. Here's how to do it right.
A client once showed me an EA with a backtest showing 300% return in 6 months with 5% drawdown. Sounded incredible. Then I looked at the settings — it was tested on just 3 months of data, with fixed lots, and the tick data quality was 30%.
That backtest meant nothing. Don't make the same mistake. Here's how to backtest properly.
Why Backtesting Matters
Backtesting tells you how your EA would have performed on historical price data. It's not perfect — markets change, past performance doesn't guarantee future results. But it's the only scientific way to validate a strategy before risking real money.
Step 1: Choose the Right Test Mode
MT5 Strategy Tester has three modes:
- "Every tick" — Simulates tick by tick using OHLC data. Fast, decent quality.
- "Every tick based on real ticks" — Uses actual tick data from your broker. Most accurate, slower.
- "1 minute OHLC" — Very fast but least accurate. Only use for initial parameter screening.
Always do your final validation test using "Every tick based on real ticks" mode. The extra time it takes is worth it for accuracy.
Step 2: Use Enough Historical Data
This is where most traders fail. They test on 3-6 months of data and think that's enough. It's not.
- Minimum: 2 years.
- Recommended: 5 years.
- Best: 10+ years for a robust strategy.
Why? Because 2 years might only cover one market condition. You want to test through bull markets, bear markets, crashes, ranging periods, and everything in between.
Step 3: Check Tick Data Quality
After running a test, check the "Modelling quality" percentage at the bottom of the report. Below 90% means the simulation had gaps and isn't reliable.
To improve data quality, download tick data from your broker directly in MT5 (Tools > History Center), or use a third-party tick data provider.
Step 4: Set Realistic Broker Conditions
Your backtest must match your live broker conditions as closely as possible:
- Spread — Use the actual spread your broker charges, not 0.
- Commission — Include commission if your broker charges it.
- Slippage — Set 2-5 points of slippage to simulate real conditions.
- Initial deposit — Use the same deposit you'll actually trade with.
What Good Results Look Like
- Profit Factor: Above 1.3. Ideally above 1.5.
- Max Drawdown: Below 20% of account.
- Win Rate: Depends on RR — 45%+ at 1:2 RR is excellent.
- Total Trades: At least 200+ trades for statistical significance.
- Sharpe Ratio: Above 1.0.
- Equity Curve: Smooth upward slope, no extreme flat periods.
How to Avoid Curve Fitting
Curve fitting (over-optimization) means tweaking your EA parameters until it looks perfect on past data — but it fails on anything new.
How to avoid it:
- Split your data: Optimize on 70% of data, test on the remaining 30%.
- Use Walk Forward Optimization — repeatedly optimize on moving windows.
- Less parameters is better. A simple strategy with 3 parameters is more robust than 20.
- If tiny parameter changes cause big result changes, the strategy is fragile.
Forward Testing: The Final Check
Before going live, run your EA on a demo account for at least 4 weeks. This is "forward testing" — real market conditions, real time, but no real money at risk.
If forward test results are roughly consistent with your backtest, you're ready to go live with real money.
Conclusion
Proper backtesting is the foundation of trusting your EA. Skip it or do it lazily, and you're gambling. Do it right, and you have real evidence that your strategy has an edge.
Every EA I build comes with a comprehensive backtest report — 5+ years of data, real tick quality, realistic broker conditions. Want an EA you can trust? Contact me at 4xfree.com.
Contact Me at 4xfree.com