Backtest EA on MT5: Strategy Tester Guide (2026)
To backtest an EA on MT5: Open Strategy Tester (Ctrl+R), select your EA and symbol, choose "Every tick based on real ticks" modeling, set a 2+ year date range, configure EA parameters in the Inputs tab, then click Start. After completion, review the Report tab for profit factor, drawdown, win rate, and Sharpe ratio. MT5's real tick data makes it superior to MT4 for accurate backtesting.
MT5's Strategy Tester is a significant upgrade over MT4's version, and I consider it the best backtesting environment available to retail traders today. The ability to backtest an EA on MT5 with actual historical tick data from your broker eliminates many of the accuracy problems that plague MT4 backtesting. In this guide, I walk you through every step of the process, from opening the tester to interpreting results like a professional.
In This Guide
Why MT5 Backtesting Is Superior to MT4
Before diving into the steps, here is why I recommend MT5 for serious EA backtesting. The MetaQuotes MT5 platform introduced several features that make backtests far more reliable:
| Feature | MT4 | MT5 |
|---|---|---|
| Tick Data | Generated from M1 bars | Real ticks from broker |
| Multi-Symbol Testing | Single symbol only | Multiple symbols simultaneously |
| Modeling Modes | 3 modes | 4 modes including real ticks |
| Optimization | Basic genetic algorithm | Advanced genetic + MQL5 Cloud |
| Visual Testing | Basic chart | Full chart with indicators |
| Forward Testing | Not built-in | Built-in forward test period |
Step 1: Open Strategy Tester
There are three ways to access the MT5 Strategy Tester:
- Press Ctrl+R (fastest method)
- Go to View → Strategy Tester from the menu
- Click the Strategy Tester icon in the toolbar
The Strategy Tester panel opens at the bottom of your MT5 window. You will see the main configuration area with dropdowns for EA selection, symbol, and modeling mode.
Step 2: Configure Test Settings
Each setting matters for getting accurate, useful results from your backtest. Here is what to configure:
- Expert Advisor: Select your EA from the dropdown (it must be installed in MQL5/Experts)
- Symbol: Choose XAUUSD or your target instrument -- use the exact name your broker provides
- Timeframe: Set the chart timeframe the EA is designed for (check EA documentation)
- Date range: Set start and end dates covering 2+ years minimum
- Deposit: Enter a realistic starting balance matching your planned live capital
- Leverage: Match your broker's actual leverage settings
Important: Click the gear icon next to the EA name to access the Inputs tab where you configure EA parameters like lot size, risk percentage, and XAUUSD-specific settings. These must match your intended live trading configuration.
Step 3: Choose the Right Modeling Mode
This is the most critical decision for backtest accuracy. MT5 offers four modeling modes, each with different trade-offs between accuracy and speed:
| Modeling Mode | Accuracy | Speed | Best Use Case |
|---|---|---|---|
| Every tick based on real ticks | Highest | Slowest | Final validation before live |
| Every tick | High | Slow | Detailed testing when real ticks unavailable |
| 1 minute OHLC | Medium | Medium | Quick parameter screening |
| Open prices only | Low | Fastest | EAs that only trade on bar open |
For gold EAs, I always recommend "Every tick based on real ticks" for the final evaluation. Gold's high volatility and wide price swings mean that tick-level accuracy is essential -- the difference between a profitable and unprofitable trade often comes down to a few points of price movement within a single candle.
Step 4: Run the Backtest
Before clicking Start, run through this pre-flight checklist:
- EA selected and parameters configured in Inputs tab
- Correct symbol and timeframe selected
- Modeling mode set to "Every tick based on real ticks" or "Every tick"
- Date range covers 2+ years of market history
- Deposit and leverage match your live trading plan
- Execution mode set appropriately (Random Delay adds realism)
Click Start and watch the progress. You can enable "Visualization" to see trades plotted on a live chart during the test -- this is slower but invaluable for understanding how the EA behaves during different market conditions.
Using MT5's Built-In Forward Testing
MT5 has a unique feature that MT4 lacks: a built-in forward test period. Enable this in the settings to automatically split your date range into an optimization period and a forward test period. The EA is optimized on the first portion and then tested "blind" on the second portion -- this is one of the best ways to detect curve-fitting.
Step 5: Analyze Results and Reports
After the test completes, review the results across three tabs in the Strategy Tester:
Backtest Tab
Shows individual trades with entry time, direction, volume, prices, and profit/loss for each position.
Graph Tab
Displays the equity curve visually. Look for a smooth upward slope with controlled drawdowns. Sudden spikes or long flat periods are warning signs.
Report Tab (Most Important)
The summary statistics that tell you whether this EA has a genuine edge:
| Metric | Good Value | What It Means |
|---|---|---|
| Profit Factor | > 1.5 | Gross profit divided by gross loss |
| Win Rate | > 60% | Percentage of trades that are profitable |
| Max Drawdown | < 20% | Largest peak-to-trough decline |
| Sharpe Ratio | > 1.0 | Risk-adjusted return quality |
| Recovery Factor | > 3.0 | Net profit divided by max drawdown |
Optimization and Forward Testing
MT5's optimization engine lets you test thousands of parameter combinations to find the best settings. However, I must warn you: optimization is a double-edged sword.
How to Optimize Safely
- Only optimize 2-3 parameters at a time -- more creates curve-fitting risk
- Use genetic algorithm mode for faster results with many parameters
- Always set a forward test period (at least 30% of total date range)
- Compare optimized results against the forward test -- if forward results are dramatically worse, you have overfitted
- Run the top 5 parameter sets on a demo account before choosing one for live trading
MQL5 Cloud Network
For complex EAs with many parameters, MT5 offers cloud-based optimization that distributes the workload across thousands of computers. This can reduce optimization time from days to hours, though it does carry a small cost per computation.
From our experience: Golden Viper EA's parameters were validated across 5+ years of live and historical data, then confirmed with live Myfxbook-verified trading producing +135% monthly returns with an 81% win rate. We encourage every user to run their own backtests and validate our results. See our demo testing guide for next steps after backtesting.
Common Backtesting Mistakes to Avoid
- Curve fitting: Over-optimizing parameters to match historical data perfectly
- Too short a test period: Use 2+ years minimum for statistical significance
- Wrong modeling mode: Using "Open prices only" for scalping or intra-bar EAs
- Ignoring spreads: Always test with realistic, broker-matched spreads
- No out-of-sample validation: Always test on data the EA was not optimized on
Frequently Asked Questions About Backtesting EA on MT5
How do I open the Strategy Tester in MT5?
Press Ctrl+R, or go to View menu and select Strategy Tester, or click the Strategy Tester icon in the toolbar. The tester panel opens at the bottom of your MT5 window with tabs for settings, inputs, and results.
Which MT5 modeling mode is most accurate?
"Every tick based on real ticks" is the most accurate mode, using actual historical tick data from your broker. If real ticks are unavailable, "Every tick" is the next best option. For gold EAs, tick-level accuracy is essential due to XAUUSD's volatility.
Why do MT5 backtests differ from live trading?
Differences occur due to variable spreads in live markets versus fixed backtesting spreads, real-world slippage that backtests cannot fully simulate, requotes during fast-moving markets, and execution latency. Expect live results to be 10-20% lower than backtest results on average.
Can I backtest MT4 EAs in MT5?
No. MT4 EAs (.ex4 files) are completely incompatible with MT5. The platforms use different programming languages (MQL4 vs MQL5). You need an MT5-specific version (.ex5) from your EA provider to run backtests in MT5.
How long should an MT5 backtest run?
Test over a minimum of 1 year, ideally 2-3 years or more. The test should generate at least 100 trades for statistical significance. Using "Every tick based on real ticks" mode over a multi-year period provides the most reliable evaluation of any EA.