ForexCopilotEA

How to backtest an Expert Advisor in the MetaTrader 5 Strategy Tester

The MetaTrader 5 Strategy Tester replays historical prices through an EA so you can see how it would have behaved. It is a useful check, but a backtest is not a prediction. This guide shows how to run one properly and how to read the result honestly.

Open the Strategy Tester

Press Ctrl+R in MetaTrader 5, or choose View, then Strategy Tester.

Choose the settings

Set these fields on the Settings tab:

  • Expert: select the EA you installed.
  • Symbol and timeframe: use the ones named in the user manual.
  • Modelling: Every tick based on real ticks gives the most realistic result when your broker provides tick data; Every tick is a good second choice. Open prices only is fast but too coarse for most EAs.
  • Date range: cover several market conditions, such as trending, ranging and high-volatility periods.
  • Deposit and leverage: match the account you plan to trade.

Load the setfile

Open the Inputs tab, click Load and pick the .set file that came with the EA. Without it the test runs on default inputs and may not reflect the intended settings.

Read the report

Do not look only at total profit. Check how the result was reached.

  • Maximum drawdown: the largest peak-to-trough loss. Ask whether you could live with it.
  • Profit factor and number of trades: a great result from very few trades is not reliable.
  • Largest losing streak and average loss compared with average win.
  • The balance and equity curve: a steady slope is more convincing than one lucky spike.

Common mistakes

  • Optimising inputs until the past looks perfect (overfitting). The EA may then fail on new data.
  • Ignoring spread, commission and slippage. Use realistic values or a variable spread.
  • Testing a short, favourable period and generalising from it.
  • Treating the backtest as a promise of future results. It is not.

Forward test before going live

After the backtest, run the EA on a demo account for a few weeks and compare it to the test. If live behaviour is very different, find out why before you risk real money.

Frequently asked questions

Which modelling mode should I use?

Every tick based on real ticks is the most realistic when your broker supplies tick history. Every tick is the next best. Avoid Open prices only for EAs that trade inside a bar.

Does a good backtest mean the EA will make money?

No. A backtest shows how the rules would have behaved on past data. Markets change, and live execution differs from simulation.

Why do my results differ from someone else's?

Different brokers, spreads, data quality, date ranges, deposit sizes and inputs all change the result.

Trading foreign exchange, gold and CFDs carries a high level of risk and may not be suitable for all investors. Past performance, backtests and live results do not guarantee future returns. This guide is general education, not financial advice.

More guides

Browse Expert Advisors