How to test an expert advisor in MT5: Strategy Tester steps and report reading
Learn how to run a historical test of an expert advisor in the MT5 Strategy Tester, set the right inputs, and read the EA test report without treating past results as predictions.

How to test an expert advisor in MT5
To test an expert advisor in MT5, open the Strategy Tester (Ctrl+R), pick the EA, symbol, timeframe, date range, modeling mode and deposit, then press Start. When the run finishes, read the Backtest and Graph tabs to see how the rules behaved on that specific historical data. The result describes the past only. It is a way to check mechanics and risk behavior, not a forecast.
The official MetaTrader 5 Strategy Tester documentation covers every option. This guide walks through the practical order of operations and what each part of the report tells you.
Automate this on MetaTrader 5
A MetaTrader 5 expert advisor with documented inputs, full backtest settings and clear risk limits.
Before you run a historical test
A test is only as useful as its setup. Check these items first.
- Compile the EA. Open MetaEditor and compile it so the latest .ex5 file appears in the Navigator.
- Load quality history. Gaps in data distort results. Open the chart of the symbol, scroll back, and let the terminal download history from your broker.
- Know the rules. Write down in plain words when the EA enters, exits, sizes positions and stops trading. If you cannot describe it, you cannot judge the report.
- Match the instrument. An EA built for EURUSD spreads and sessions may behave very differently on a futures-style symbol such as ES or NQ, or on an energy contract like CL, where contract specifications and tick values differ.
Step-by-step: running the MT5 Strategy Tester
1. Open the tester and choose the EA
Press Ctrl+R or use View, then Strategy Tester. In the Settings tab select Expert Advisor as the test type, then choose your EA from the dropdown.
2. Select symbol, timeframe and dates
Pick the symbol, for example EURUSD, and the timeframe the EA was designed for. Choose a date range that includes different conditions: trends, ranges, high volatility and quiet periods. A three-month window in one regime says little about how the logic handles others.
3. Choose the modeling mode
This setting matters more than most beginners expect.
- Every tick based on real ticks: uses actual recorded ticks from the broker. It is the most realistic and the slowest, and is best for scalping or tight-stop logic.
- Every tick: generates ticks from minute bars. Good for general testing.
- 1 minute OHLC: faster, less precise intra-bar behavior.
- Open prices only: only suitable for EAs that act once per bar on the bar open.
If an EA uses small stops on EURUSD or NQ-like instruments, a coarse mode can hide slippage-like effects and produce a flattering picture.
4. Set deposit, leverage and delay
Use a deposit and leverage close to what you would really use. Add an execution delay (for example 50 to 100 ms) to simulate latency rather than assuming instant fills. Spread should be set to current or a realistic fixed value, not zero.
5. Set the inputs
Click the Inputs tab and review each parameter: lot size, stop loss, take profit, session filters, maximum spread. Keep a note of every change so you can reproduce a run later.
6. Start and watch the Journal
Press Start. Check the Journal tab for errors such as invalid stops, not enough money or missing history. A run with many errors is not a valid test even if it produces a number.
The modeling choice can change results more than any input. MT5 Strategy Tester modeling options explained compares real ticks, every tick, OHLC and open prices.
How to read the EA test report
Open the Backtest tab after the run. The numbers below are descriptive statistics of that sample.
Net profit, drawdown and equity
Net profit alone tells you very little. Look at maximal drawdown (balance and equity) next to it. Equity drawdown includes open positions and is usually larger. Ask whether you could realistically tolerate that drawdown on your own account size.
Profit factor, expected payoff and trade count
Profit factor is gross profit divided by gross loss. Expected payoff is the average result per trade. Both depend heavily on sample size. A report with 30 trades is statistically thin, while several hundred trades across varied conditions give a more meaningful picture, though still no guarantee.
Consecutive losses and trade distribution
Check the longest losing streak and whether a few large winners create most of the profit. If removing the top two trades erases the result, the outcome is fragile.
The Graph and Results tabs
The balance and equity curve shows how the path unfolded. A smooth end result can hide long flat periods or sharp dips. The Results tab lists each deal so you can verify that entries match the rules you wrote down.
Avoiding common testing mistakes
- Over-optimization: tuning inputs until the curve looks perfect fits noise. Optimize on one period, then check a separate period the optimizer never saw (forward testing in MT5 supports this).
- Ignoring costs: commission, swap and spread change results, especially for short-term EAs on EURUSD.
- Treating one run as proof: vary dates, symbols and inputs to see whether results degrade gracefully or collapse.
- Confusing past and future: the report shows what the rules would have done on recorded data. Markets change, and nothing in a report promises similar behavior later.
After a historical test, a demo account run helps verify live execution, spreads and platform behavior with no real capital at risk.
If the EA trades in the tester but stays silent on a chart, check MT5 expert advisor not placing trades and read its messages with MT5 expert advisor log errors explained.
Forward testing the EA on a demo account
A historical test shows what the rules would have done on recorded data. A demo forward test shows what happens with live prices, real spreads and your own terminal. Run one before any live account.
Set up a demo account that resembles the live one
A forward test is only as useful as the environment it runs in. Before attaching anything, match the demo to the account you would eventually trade.
- Open the demo with the same broker and, where possible, the same account type (raw spread, standard, netting or hedging). MetaTrader 5 explains the process in its help page on opening a demo account.
- Check the symbol name. Brokers often add suffixes, so EURUSD on one server can be EURUSD.r or EURUSDm on another. An EA hard-coded to one name may simply never trade.
- Open Market Watch, right-click the symbol and choose Specification. Write down contract size, tick size, minimum lot, lot step, stop level and swap. Compare them with the symbol you used in the Strategy Tester.
- Set the demo balance and leverage close to what you plan to use live, so position sizing behaves the same way.
- Note the server time zone. Session filters inside the EA usually read server time, and a different offset shifts every entry.
For index products, be precise about what you are trading. A US 500 CFD on an MT5 server is not the CME ES contract, which has a 0.25 tick size and its own trading hours. If your EA was designed around ES or CL futures behavior, confirm the MT5 symbol's tick size and session in its specification rather than assuming they match.
What to record during the forward test
This is the core of the exercise. Build a simple spreadsheet with one row per trade and these columns:
| Column | What to write | Where to find it |
|---|---|---|
| Signal time | Time the EA decided to trade | Experts tab, if the EA prints its decisions |
| Requested price | Price the EA asked for | EA logs or order comment, if available |
| Fill price | Actual execution price | History tab |
| Slippage | Fill minus requested, in points | Calculated |
| Spread at entry | Spread when the order was sent | EA logs, if printed, or Market Watch notes |
| Stop and target | Levels placed | Trade or History tab |
| Exit reason | Stop, target, trailing, time exit, manual | History tab and EA logs |
| Notes | Disconnection, news release, rejection | Journal and your own observations |
On EURUSD, for example, a scalping EA that looked clean in the tester can show wider spreads around the daily rollover hour on a demo. That kind of detail is exactly what this sheet is meant to capture.
Reading the EA logs during the test
The Experts tab shows messages printed by the EA: initialization, signals, order requests and errors. The Journal tab shows terminal events such as connection status and trade server responses. Both are also saved as daily text files. Right-click inside either tab and choose Open to reach the log folder, or use File >> Open Data Folder and look in the Logs folders.
You do not need to diagnose every message here. Note the timestamp of anything unusual, such as a rejected order or an invalid stops message, and move on. For decoding specific errors, use the guide to MT5 expert advisor log errors explained.
Compare the forward test with a backtest over the same period
Once you have enough trades for the comparison to mean something, decided in advance as a number of trades or a number of weeks, run a second historical test that covers exactly the forward test dates.
- Open the Strategy Tester and select the same EA, symbol, timeframe and set file.
- Set the date range to the start and end of your demo run.
- Choose the most realistic modeling available, typically Every tick based on real ticks, if your broker provides that history.
- Run the test and export or note the trade list.
- Export your demo history: in the History tab, right-click and choose Report.
Now match trades row by row. You are looking for four types of difference:
- Missing trades: the backtest traded but the demo did not. Common causes are a disconnection, a symbol name mismatch, a spread filter blocking entry or a stop level rejection.
- Extra trades: the demo traded but the backtest did not. Often caused by a restart that reset the EA's internal state, or by tick data that differs between live feed and history.
- Price differences: same trade, different entry or exit. Usually slippage, spread or a stop filled beyond its level during a fast move.
- Timing differences: same trade, shifted by a bar or more. Check server time offsets and whether the EA acts on a new bar or on every tick.
Write the cause next to each mismatch when you can identify it, and "unknown" when you cannot. A growing column of unknowns is a reason to keep testing, not to go live.
Know the limits of a demo account
A demo forward test is closer to reality than a backtest, but it is still not live trading. Demo servers may fill orders without the queue, partial fills or rejections you can meet on a live account, and liquidity in a fast market can behave differently. Treat demo fills as a best case. If spread or slippage already damages the results on demo, expect live conditions to be at least as demanding. The CFTC's Learn and Protect resources are worth reading on the risks of leveraged trading and automated systems sold online.
It also helps to review your safeguards before any live step. Maximum spread filters, lot sizing and daily loss limits are covered in MT5 expert advisor risk settings explained.
Using order flow context alongside a test
Some traders compare an EA's entries with what was happening in the order book and traded volume at the time. If you study futures such as ES or CL in Sierra Chart, understanding how to read a footprint chart can help you judge whether an automated rule respected or ignored meaningful price levels. For contract specifications and trading hours that affect test assumptions, see the CME Group ES futures page.
Conclusion
Testing an EA in MT5 means setting realistic data, modeling, costs and inputs, then reading the report for risk, consistency and rule behavior rather than for a promise. Run multiple periods, check the Journal for errors, validate on unseen data and move to demo before any live decision. Treat every report as evidence about the past only. If you want tools for reading order flow or exploring MT5 robots with this disciplined approach, SierraOnShop offers Sierra Chart tools, expert advisors and trading courses.
FAQ
Why does my MT5 backtest show no trades?
Common causes are missing history, a date range with no data, inputs that block entries (such as a tight spread filter), or an EA restricted to a specific symbol or session. Check the Journal tab for messages.
Is a higher modeling quality percentage always better?
Higher quality means the tester used more complete tick data, which generally gives more reliable execution simulation. It does not make the strategy itself robust or predictive.
Can I test an EA on multiple symbols at once?
Yes, if the EA is written to use several symbols. Otherwise run separate tests per symbol. You can also use the optimization mode to run many input combinations, but guard against over-fitting.
What is forward testing in MT5?
Forward testing reserves part of your date range that optimization does not use, then checks the chosen inputs on it. It helps reveal whether good results came from fitting to one sample.
Run it in MetaTrader 5
Written by
Clement
Futures trader for more than seven years, specialized in order book and order flow scalping on US index futures, now building automated strategies. Founder of SierraOnShop.
More about the authorReady to run an expert advisor?
A MetaTrader 5 expert advisor with documented inputs, full backtest settings and clear risk limits.