All Playbooks
Playbook

Backtesting Your EA Properly

Most backtests lie. Learn to create reliable tests that predict real-world performance instead of just confirming your hopes.

12 min read
Intermediate

5-Step Backtesting Process

1Get Quality Historical Data

  • Use tick data or M1 data for accurate results (avoid H1+ for scalpers)
  • Ensure data covers multiple market conditions (trending, ranging, volatile)
  • Minimum 2-3 years of data, ideally 5+ years
  • Verify data has no gaps or missing periods
  • Match data timezone to your broker's server time
Common pitfall:Using built-in MT4/MT5 data often has gaps and low quality

2Configure Realistic Settings

  • Set spread to typical live values (not zero spread)
  • Enable variable spread if your broker has it
  • Set commission correctly (per lot or per trade)
  • Use 'Every tick based on real ticks' mode in MT5
  • Set starting balance matching your intended live capital
Common pitfall:Backtesting with 0 spread inflates results dramatically

3Run Multi-Period Tests

  • Test across 3+ different time periods separately
  • Include 2008, 2020, 2022 for crisis behavior
  • Test recent 6 months separately for current relevance
  • Run walk-forward analysis if possible
  • Compare results across different currency pairs
Common pitfall:A strategy that only worked 2017-2019 may not work today

4Analyze Beyond Profit

  • Calculate Sharpe ratio (aim for >1.0)
  • Check max drawdown duration (not just depth)
  • Review monthly return consistency
  • Examine losing streak statistics
  • Verify trade distribution across time periods
Common pitfall:High profit with 60% drawdown is not a viable strategy

5Validate with Out-of-Sample

  • Reserve 20-30% of data for out-of-sample testing
  • Never optimize on out-of-sample data
  • Compare in-sample vs out-of-sample metrics
  • If OOS is >30% worse, strategy may be overfit
  • Repeat with different OOS periods
Common pitfall:Optimizing on all data guarantees curve-fitting

Key Metrics to Evaluate

MetricGoodWarningDescription
Net Profit>0NegativeTotal profit after all costs
Profit Factor>1.5<1.2Gross profit / Gross loss
Max Drawdown<20%>40%Largest peak-to-trough decline
Win Rate40-70%<30% or >85%Percentage of winning trades
Sharpe Ratio>1.0<0.5Risk-adjusted returns
Recovery Factor>3<1Net profit / Max drawdown
Trade Count>100<30Statistical significance
Avg Trade>3x spread<spreadAverage profit per trade

Backtest Validation Checklist

Before trusting your backtest results, verify all critical items. Missing any critical item means your results are unreliable.

Used quality tick or M1 data (not built-in)Critical
Set realistic spread and commissionCritical
Tested minimum 2 years of dataCritical
Reserved out-of-sample data for validationCritical
Achieved 100+ trades for statistical significanceCritical
Max drawdown acceptable for your risk toleranceCritical
Tested across different market conditions
Profit factor above 1.3
Average trade covers spread + buffer
Consistent monthly returns (low variance)

Common Backtesting Mistakes

Optimizing until it looks good

Why it matters: With enough parameter combinations, any strategy can look profitable on historical data.

Fix: Limit optimization iterations. Use walk-forward analysis. Always test out-of-sample.

Ignoring slippage and execution

Why it matters: Backtests assume perfect fills. Reality includes slippage, requotes, and partial fills.

Fix: Add 0.5-1 pip slippage to tests. Reduce expected performance by 20-30%.

Testing only on favorable periods

Why it matters: Every period has a strategy that works. Survivorship bias creates false confidence.

Fix: Include market crashes, low volatility periods, and ranging markets in your tests.

Using too few trades for conclusions

Why it matters: 30 trades could be pure luck. You need statistical significance.

Fix: Minimum 100 trades, ideally 200+. Be skeptical of short-term results.

Not accounting for changing market conditions

Why it matters: Markets evolve. 2015 EURUSD behaves differently than 2023 EURUSD.

Fix: Weight recent data more heavily. Plan for strategy degradation over time.

Templates & Resources

Realistic Test Settings

Pre-configured MT5 settings with proper spread/commission.

Backtest Report Template

Spreadsheet for tracking and comparing backtest results.

Build a Bot Worth Testing

Create your trading strategy and put it through rigorous validation.

Start Building