Set-up

How to Back-Test an Expert Advisor in MetaTrader 5

A back-test shows how an Expert Advisor's rules would have traded past prices. Here is how to run one in MT5's Strategy Tester and how to read the report.

2 min read Stop 4 of 10 on the route

A back-test runs an Expert Advisor over past prices to show how its rules would have traded: how often, how long its losing runs get, what each setting changes. MetaTrader 5 has it built in: the Strategy Tester.

Set up the test

Strategy Tester Ctrl+R

Expert
the EA you test
Symbol and timeframe
the ones it is made for
Dates
a year or more
Deposit and leverage
like your real account

Modelling

How faithful

How fast

Choose Every tick based on real ticks: the slowest mode and the most faithful, because it replays the prices and spreads your broker recorded. Press a mode to compare.
  1. 1
    Open the Strategy Tester

    View > Strategy Tester, or Ctrl+R. Choose a Single test.

  2. 2
    Fill in the fields as above

    A year or more of dates, so the rules meet different conditions, and Every tick based on real ticks.

  3. 3
    Press Start

    Then read the report.

Read the report

Thirty trades show luck. A few hundred start to show a method.

An illustration of a report, not the result of any Expert Advisor.
Read five things first: total trades, profit factor, maximal drawdown, consecutive losses and the shape of the graph. Press each figure.

Three mistakes to avoid

After the back-test

Then a demo account

A back-test is a simulation. Run the EA on a demo account with the broker you plan to use, to see real spreads and real execution. K3Bxn licences include an allowance of demo accounts for exactly this, and a K3Bxn Expert Advisor can be back-tested once it has been activated on a chart of the same account.

Check yourself

2 questions

  1. Which modelling is the most faithful?

  2. A test of 30 trades shows a profit factor of 2.5. What does it prove?

See the Expert Advisors, or read how to choose a broker.

You have reached the end of this guide.It is ticked off on your route, on this device.

Keep reading