How to Backtest an EA in the MT5 Strategy Tester
Rishi Ajmera · · Last updated
The Strategy Tester runs an Expert Advisor (EA) on past price data, so you can check that it follows your rules before it trades a live account. A backtest shows how the rules would have behaved in the past. It is not a forecast and says nothing about future results.
Run a backtest in MT5
- Open View → Strategy Tester (Ctrl+R).
- On the Settings tab, choose the Expert, the Symbol and the Timeframe.
- Set the Date range. A custom period lets you pick exact start and end dates.
- Choose the Modelling (see below), the deposit and the leverage. Leave Optimization off for a single test.
- Open the Inputs tab and set the EA's values, or load a .set file.
- Tick Visual mode if you want to watch the trades on a chart, then click Start.
Which modelling to choose
- Every tick based on real ticks uses the tick history your broker provides. It is the most detailed and the slowest.
- Every tick builds ticks from one-minute bars.
- 1 minute OHLC uses only the open, high, low and close of each minute — quicker, less detailed.
- Open prices only is the fastest, and suits EAs that act only when a new bar opens.
Reading the results
- Backtest: the report — trades, costs and the settings used.
- Graph: how the test account's balance moved during the test.
- Journal: messages from the tester and the EA. Check it first if no trades were placed.
Tips for a fair test
- Test the symbol and timeframe the EA was built for, with the spread and commission your account really pays.
- Use the same settings when you compare two versions of an EA, for example before and after a conversion from MT4.
- In MT4 the tester is also under View → Strategy Tester (Ctrl+R), with fewer modelling choices.
Need an EA to test?
MyAlgoMate's developers build custom MT4 and MT5 Expert Advisors to your rules and test them in the Strategy Tester with you before delivery. We don't supply strategies — the rules are yours.
If you live in India: under RBI rules, residents may trade forex only through authorised routes, such as currency derivatives on recognised Indian stock exchanges through a SEBI-registered broker. Check that your broker and the instruments you trade are permitted before you run any EA. MyAlgoMate develops software only and does not advise on brokers, markets or strategies.
FAQ
How do I open the Strategy Tester in MT5?
Click View → Strategy Tester, or press Ctrl+R.
Which modelling is most accurate in MT5?
Every tick based on real ticks, because it uses the recorded tick history. It is also the slowest.
Does a good backtest mean the EA will do well live?
No. A backtest only shows how the rules behaved on past data. Live conditions such as spreads, slippage and market changes differ, and past behaviour is not a guide to the future.