Method of Backtesting on MT5 (Windows)

In MT5, you can perform EA backtesting.

Here, we will guide you through the basic method of backtesting.

Backtesting can simply test set parameters, or it can involve optimization testing (determining which parameter values yield the best results), which takes more time.

MT5 Backtesting Setup

Prepare the EA you want to backtest in advance and install it on MT5.

Displaying the Strategy Tester

MT5 backtesting is performed using a tool called the Strategy Tester.
To display the Strategy Tester, select "Strategy Tester" from the "View" menu in MT5.

Strategy Tester 'Settings' Tab

In the 'Settings' tab of the Strategy Tester, configure the following items (refer to the image numbers):

①Select the Expert Advisor to test.
②Select the symbol and chart timeframe to test.
③Set the testing period. You can choose specific dates or select options like last month or last year.
④If performing a forward test, specify the ratio for the selected portion of the period.
⑤If testing with a certain delay in order execution, set it here.
⑥Choose the method of testing.
⑦Set the starting amount for the test.
⑧Set the leverage.
⑨Choose whether to perform optimization and select the method of optimization. 'Disable' means no optimization. Other options specify the method of optimization.
⑩If not optimizing: Check for visual mode to see the trade progression (visual mode increases testing time).
If optimizing: Select the criteria for optimization.

Strategy Tester 'Parameters' Tab

In the 'Parameters' tab, set the parameters and the settings for optimization testing.
①If performing optimization testing, check the items.
②If testing without optimization, set the parameters in the value field.
③Specify the minimum value for optimization testing.
④Specify the interval from the start value for optimization testing.
⑤Specify the maximum value for optimization testing.
⑥The number of patterns to be tested during optimization testing will be displayed.

Starting the Test

Once the settings are complete, click the Start button in the lower right to begin the test.

If the testing period is long or if there are many combinations in optimization testing, it may take several hours to several days, so try to configure the test period to be as short as possible.

Checking MT5 Backtest Results

Once the test is completed, depending on the test content, the following tabs appear in the Strategy Tester, allowing you to check the results.

Backtest 1

You can check backtest data overview and scroll down to view it in a graph.

Backtest 2

Check the number of trades and profit/loss trends by time of day in a graph.

Backtest 3

Check the correlation between profit/loss, maximum favorable excursion (MFE), and maximum adverse excursion (MAE) in a graph.

Backtest 4

Check the distribution of position duration and profit/loss in a graph.

Graph

Check the trends of account balance and margin in a graph. The blue line represents the account balance, and the green line represents the margin.

Optimization Results

When optimization is performed, you can check the results. You can sort the results by each item.

Saving Reports

Right-click within the backtest, select Save Report, and save it in HTML format viewable in a browser.