How to test an expert advisor in MT5: Strategy Tester steps and report reading

6 min read

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: Strategy Tester steps and report reading

Get professional chartbooks for Sierra Chart

DOM, footprint, heatmap and market profile setups, installed in seconds. Our trading courses cover the method behind them.

★★★★★
“Chartbooks are superb, I save a lot of time! Thanks for these quality products.”
@traderpro95
Instant deliverySecure payment99% satisfactionLifetime access

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.

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.

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.

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.

Read the order flow with the right tools

Start with a professional Sierra Chart chartbook, or learn the method with our trading courses.

★★★★★
“Just received the footprint chartbook. Installation took 30 seconds, works perfectly on Sierra 2800.”
@orderflowpro
Instant deliverySecure payment99% satisfactionLifetime access