Guide · MetaTrader

How to backtest in MetaTrader 5

MetaTrader 5 comes with a Strategy Tester. You pick the robot, the symbol, the dates; a few minutes later you have a report with every simulated trade.

The steps

  • Open the Strategy Tester (Ctrl + R).
  • Choose the EA, the symbol, the timeframe.
  • Set the dates: the more years, the better.
  • Under “Modelling”, use “Every tick based on real ticks” if your broker provides them.
  • Set the initial deposit; the leverage too.
  • Click “Start”.

What to check in the results

  • Net profit, after commissions.
  • Maximum equity drawdown.
  • Number of trades: with fewer than 100, there is little you can conclude.
  • Profit Factor. How to read it.

Save the report

In the “Backtest” tab, right-click, then “Report”. You can save it as HTML or as an Excel file.

That file is your reference for comparing later with what the robot does on your account.

What the tester gets wrong

  • The spread: with a fixed one, news releases look better than they really were.
  • Slippage, which doesn't exist there unless you simulate it.
  • Your account's commission, if the symbol doesn't have it configured.

In MetaTrader 4

Its tester is more limited: a single symbol, fixed spread, no real ticks. The backtest usually comes out somewhat better than live trading.

The modeling modes

  • “Every tick based on real ticks”: uses the prices your broker actually quoted. The most accurate, also the slowest.
  • “Every tick”: generates price movement from one-minute candles.
  • “1 minute OHLC”: four prices per minute. Fast; fine for strategies on higher timeframes.
  • “Open prices only”: for robots that make their decisions when each candle opens.

Data quality

The tester downloads your broker's history. If data is missing, the report shows it under “History quality”.

The earliest years tend to have less detail. A result that depends only on that stretch deserves suspicion.

Optimizing is not testing

The same tester can search for the best parameters. Use it with care: always keep a period untouched to check against. MetaTrader 5 offers this with its “Forward” option.

Common mistakes

  • Testing only the period in which the robot wins.
  • Optimizing many parameters and keeping the best result. Overfitting.
  • Trusting “Open prices only” for an EA that trades within the candle.

Frequently asked questions

Can you backtest in MT5?

Yes. MetaTrader 5 includes a Strategy Tester (Ctrl + R) that simulates a robot on historical data, with real ticks if the broker provides them.

Which “Modelling” setting should I use in the MetaTrader 5 Strategy Tester?

“Every tick based on real ticks” is the most accurate. “Open prices only” is fast, but it only suits robots that make their decisions when each candle opens.

How do I save a backtest report in MT5?

In the Strategy Tester's “Backtest” tab, right-click and choose “Report”. MetaTrader 5 saves it as HTML or as an Excel file.

Put your robots in orbit.

Try it free

Sign up in a minute, no card required.