How to Backtest in MetaTrader 5
A backtest runs an EA against past price data to show how the system behaves. We recommend running your own, with the settings and broker you'll actually use, rather than relying only on the results we show on this site.
Before you start
- Purchased on MQL5: you can test right away. Haven't bought yet? Download the Free Demo from the product page on MQL5 — it runs in the Strategy Tester only.
- Free version via partner broker: you can test right away. The license check is skipped automatically in the Strategy Tester, and the EA's panel shows
BACKTEST.
Steps
- Open the Strategy Tester with
Ctrl + R, or View → Strategy Tester. - Fill in the Settings tab:
| Field | Set to | Note |
|---|---|---|
| Expert | The EA you want to test | |
| Symbol | The strategy's symbol, from the broker you'll trade with | Spreads and contract sizes differ between brokers |
| Timeframe | As stated on the strategy's backtest page | So you can compare with our results |
| Date | The period you want | Longer periods cover more market conditions |
| Modelling | Every tick based on real ticks | Most accurate, uses real spreads, but slowest |
| Deposit | The amount you'll actually trade with | |
| Leverage | Match your real account |
- Inputs tab: use the same settings you'll run live, especially risk per trade.
- To see the EA's panel and the chart during the test, tick Visual mode (slower). Without it the panel isn't shown, but the results are the same.
- Click Start.
The first run downloads historical price data from your broker. It can take a while, depending on the length of the period and your internet speed.
Viewing the results
When the test finishes, new tabs appear:
- Backtest: all the summary figures — net profit, profit factor, drawdown and more.
- Graph: your balance over the whole test.
To understand each figure, see Reading the Backtest Numbers.
Exporting the report
Right-click the Backtest tab → Report → choose HTML or Open XML to save it as a file. You can open that file in analysis tools like QuantAnalyzer — the backtest images on our site were made this way.
Limits of backtesting
- The past isn't the future. Markets can behave very differently from the period you tested.
- Results vary by broker. Spreads, commissions and slippage differ, and can change results a lot.
- Live trading has things the tester doesn't simulate — dropped connections, VPS downtime, price gaps after weekends.
- Don't tune settings until the backtest looks perfect. Fitting parameters too closely to the past (overfitting) usually makes live results worse than what you saw.
The best approach: backtest to understand the system, then run it on a demo account before using real money.
Still stuck? Email us at support@cloudpips.io and we'll help you sort it out.

