Risk Warning: CFDs and margin FX are leveraged products that carry a high level of risk to your capital. Trading is not suitable for everyone and may result in you losing substantially more than your initial investment. Please consider our PDS

A beginners guide to using the MT4 strategy tester

A beginners guide to using the MT4 strategy tester
- Quick introduction to MT4 strategy tester navigation
- MT4 strategy tester configuration options
- MT4 strategy tester: Spread, Date, Visual mode
- MT4 strategy tester: Expert Properties
- MT4 Strategy Tester: Other properties
- Preparing your data for backtesting
- Backtesting EA on MT4 strategy tester
- Using Strategy Tester with Visual Mode
- Backtesting Indicator on MT4 strategy tester
- Using the MT4 Strategy Tester

Backtesting trading strategies are one of the key aspects for a forex trader. For someone who uses technical indicators, a trading strategy tester makes for an ideal tool. The MetaTrader 4 is one of the most popular trading platforms. It also offers traders the functionality to back-test their trading strategies as well as indicators.

However, not many traders know how to use the MT4 strategy tester thoroughly. This article aims to provide the reader with basic insights into using the MT4 strategy tester. This includes using automated strategies by means of an Expert Advisor, or just testing a custom indicator.

The main point to bear in mind is that the strategy tester is part of the MT4 trading platform. Therefore, it works well whether you are connected to a demo trading account or a real trading account.

Before you begin to use the MT4 strategy tester, a few things should be kept in mind. These include:

  1. Data history for the instruments on which you want to backtest
  2. The expert advisor or the technical indicator for which you want to backtest
  3. Visual backtesting or automated `backtesting which gives you the trading performance history

Before you start to hit the automated trading strategy solution you should follow the steps outlined in detail below.

A quick introduction to MT4 strategy tester navigation

The MT4 strategy tester can be accessed by clicking on the Strategy Tester icon, or by using the keyboard shortcut Ctrl + R. This will open a new sub-window, below your trading terminal window.

The picture below represents the strategy tester window when opened.

MT4 Strategy Tester Window
MT4 Strategy Tester Window

The above window has multiple options and functions that you should be aware of.

MT4 strategy tester configuration options

Firstly, in the top left corner, the dropdown allows you to choose between Expert Advisor (EA) or Indicator. Depending on what choice you use, the appropriate EA or indicators are then shown in the dropdown to the right of it.

MT4 Strategy Tester Expert Properties
MT4 Strategy Tester Expert Properties

From here, you can select the appropriate indicator or EA of your choice. In the above example, you will notice that we have selected Expert Advisor, with the Moving Average.ex4 EA selected.

Below this main dropdown, you will then see the Symbol. As the name suggests, the Symbol allows you to choose from the various instruments available with your forex broker. To the right side of this Symbol dropdown, you can find the period settings. You can use the dropdown to choose the time period for which you want to backtest.

In the above example, we have the H1 time period, meaning that the EA will be run on the 1-hour chart timeframe.

Below the symbol dropdown, we then have the Model dropdown. Here, you can choose from any of the following:

  • Every tick (the most precise method based on all available least timeframes to generate each tick)
  • Control points (a very crude method based on the nearest less timeframe, the results must not be considered)
  • Open prices only (fastest method to analyze the bar just completed. Only for EA’s that explicitly control bar opening)

From the above there, a forex trader would generally use the Every tick option.

MT4 strategy tester: Spread, Date, Visual mode

The Spread dropdown allows you to select the current spread or set a specific spread of your choice.

Use date, when checked allows you to specify the minimum and maximum dates for backtesting your trading strategy.

The visual mode, when checked and based on the slider allows you to control the speed of visual backtesting. This will allow you to see how your EA places trades as and when signals form. There is also the option to select the Skip to, which when based on the date in the date field to the right allows you to skip to a particular point in time.

MT4 strategy tester: Expert Properties

Finally, on the right side, we have a series of buttons with their respective names. The expert properties button allows you to specify the properties such as the initial deposit, currency, whether to take long or short or both positions.

In the Optimization section, you can choose between a host of different options such as Balance, Profit Factor, Drawdown percentage, or even use custom settings. This is important and traders should spend some time exploring the different options available.

In the same window, you also have the inputs tab. Here, you can select the various parameters if you want to do recursive testing. This option allows you to use a step function across the various settings from your EA.

In the Optimization tab, you can further customize the EA to limit it to various parameters such as maximum profits, consecutive wins, losses, and many more. One thing to bear in mind is that using these settings will force your EA to work in a specific way. Hence, the results derived from backtesting using the MT4 strategy tester may not be the same when forward testing.

MT4 Strategy Tester: Other properties

There are other property windows available too, but they are not as critical or useful for your backtesting. For example, the Symbol Properties button simply shows you the properties of the symbol that you want to backtest for.

The Open chart function allows you to open the chart for the symbol that you are backtesting. This can be used if you are not using the Visual mode feature. Finally, the Modify Expert is quick access to opening the MQL4 editor.

Preparing your data for backtesting

Without data, no matter how good your trading strategy is, it will always fail or provide incorrect results. Hence, the first starting point is to always ensure that you have the full historical data, also known as tick-data before backtesting.

To do this, you need to go to Tools > History Center and select the symbol for which you want to backtest. Then, click on the different chart time frames and press the Download button. This will retrieve the historical data available from your forex broker.

It is important that you have all the different time frame data downloaded. When the data is downloaded, you will see that the icon will turn from grey to color format as seen below.

MT4 History Center Download
MT4 History Center Download

In the above example, you can see that we downloaded data from the 1-minute up to 4-hour chart time frame. Consequently, the icons next to these time frames are in colour. However, since we did not download the daily, weekly, and monthly data, the icons next to these timeframes are greyed out.

It is important to note that not all forex brokers will have the same historical data. Hence, it is best to choose a forex broker that also allows you access to good historical time-series data. If required, you can also download historical data from other sources and prepare the data into the time-series data of your choice.

This would mean that you simply import the data to your MT4 trading platform.

Once you have the data downloaded, you can then proceed to the MT4 history centre to start your backtesting.

In our example, we will use the standard moving average based EA on the 30-minute chart for the S&P500 index CFD, for which we have already downloaded the data.

Backtesting EA on MT4 strategy tester

To backtest an EA you can select the appropriate configurations and then set the symbol and the period. Once done, you can choose between the visual mode or the non-visual mode. As the two options suggest, the visual mode takes a lot more time for backtesting compared to the non-visual mode.

The results from these two methods will of course be the same.

When you select the non-visual mode, you can click on start. This will show a progress bar informing you when the backtesting is complete.

MT4 Backtesting nonvisual mode
MT4 Backtesting nonvisual mode

Below the MT4 strategy tester, you will find the various tabs called Results, Graph, Report, and Journal.

The results tab gives you a detailed overview of the total profits and losses made per trade. It also shows you the size of the trading position taken, the entry and exit price, and the profits made off that trade.

The Graph tab is the one that traders use the most. This is a graphical representation of the results of your backtesting strategy. It is simply a chart of your trading balance.

MT4 Strategy Tester Results
MT4 Strategy Tester Results

When looking at the chart, it will immediately tell you whether your trading strategy resulted in a profit or in a loss.

The report section is also quite important as it drills down into further data. Here, you can see various aspects of the backtesting results, ranging from the modeling quality to the spread, gross profit and loss, drawdown, and other details.

MT4 Strategy Tester Report
MT4 Strategy Tester Report

The above screenshot shows how you can use the report tab to get a further understanding of your trading strategy performance. You can right-click anywhere in the Report tab and choose Save as report to get an HTML output of your trading results.

There isn’t much to cover about the Journal tab. This is the same journal tab that you would see on your trading terminal window.

It merely shows the various orders placed during the backtesting period.

Using Strategy Tester with Visual Mode

When using the visual mode, you can effectively see the trading in live-action. The trade entry and exit are shown as and when the signals are triggered.

MT4 Strategy Tester Visual Mode
MT4 Strategy Tester Visual Mode

As mentioned, the visual mode takes a slightly longer time since the chart is live. Traders use visual mode when they already know how the signals are forming. However, using visual mode with an EA doesn’t offer many insights.

On the contrary, the visual mode is more useful when you are backtesting using a technical indicator which we will cover in the next section below.

Backtesting Indicator on MT4 strategy tester

To back-testing indicators on the MT4 strategy tester, you only need to change the dropdown from Expert Advisor to Indicator.

You can then move the slider along to increase or decrease the speed of the visual chart. This will speed up the visual chart and the indicator that is plotted on the chart as well. The visual mode is a great way for you to understand how the indicator is performing against price action.

MT4 Strategy Tester Indicator Back-testing
MT4 Strategy Tester Indicator Back-testing

Note that the backtesting based on indicator will not place any trades but is used to simply act as a visual way to analyze how an indicator works.

This feature is useful especially if you want to download any indicators from the MQL4.com marketplace. Instead of purchasing the indicator directly, you can merely download a demo and use it in your strategy testing function.

Unlike the backtesting for EA, the indicator-based backtesting does not give you any further details such as the results or the report tab. Some may wonder what is the purpose of backtesting an indicator. There are many use cases for this.

For starters, the backtesting visual mode for indicators in MT4 can be useful if you have purchased or downloaded a custom indicator. This visual mode will give you an idea of how the indicator is doing based on the market conditions.

Using the MT4 Strategy Tester

In conclusion, this article gives the reader basic insight into how to use the MT4 strategy tester function. It is a great way for traders to slowly start using the strategy tester feature to being backtesting any automated trading strategies they may have.

The MT4 strategy tester also helps you to analyze your backtesting results. However, as with anything, traders should be careful not to overfit their backtesting configurations. Remember that while may end up seeing good results in the backtesting period, the same cannot be said if you are to forward test the same strategy.

Still, the MT4 strategy tester is a free and useful tool that is built into the MT4 trading platform. Without having to use any additional tools, this strategy tester feature is a great addition where the trader does not have to move away from the MT4 trading terminal.

While the concepts of backtesting may seem complex at first, traders can first practice using the strategy tester as there are a lot more options to explore, which we will cover in the upcoming articles.

Open a FREE CFD demo trading account


The information provided is of a general nature and is not intended to be personalised financial advice. The information provided is not intended to be a substitute for professional advice. You may seek appropriate personalised financial advice from a qualified professional to suit your individual circumstances.

Trading in Rockfort Markets derivative products may not be suitable for everyone as derivative products may be considered as high risk. Please ensure that you understand the risks involved. A Product Disclosure Statement can be obtained here and should be considered before trading with us.

William, B.

May 10, 2022

Share on facebook
Share on twitter
Share on linkedin

Related blog posts

Get weekly insights from award-winning team

Sign up for all the latest updates from our Rockfort Academy including news, industry analysis and updates from trading central team.

  * By entering your email, you agree to our Terms of Service and Privacy Policy.

Open a FREE Demo Trading Account

Rockfort Markets’ products are risky; please read our PDS.