×

CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 75.00% of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.

Authorised and Regulated: FCA UK

MT4 Expert Advisor Optimisation Tips

Wouldn’t it be too good to be true if you could simply buy a MetaTrader Expert Advisor and use it straight out of the package without having to change settings or optimise it? Well, that’s exactly what it is – too good to be true. The reality is that the default settings are unlikely to be optimised either to the existing market conditions or to your preferred parameters. This is why it is a good idea to know how to optimise MT4 EAs. After all, one of the major advantages of using MetaTrader is the ability to automate trading based on customizable strategies and EAs. So, why not make the most of the power of this tool?

Steps to Optimising MT4 EAs

To avoid costly mistakes in automated trading, the first step is to test and optimise the Expert Advisor. Here is what you need to do:

Step 1: Go to the Tester Window

This is a multifunction window that allows you to test your trading strategies, as well as to optimise EA parameters. Once you open the Tester window (either via Main Menu, View, Strategy Tester or through the Strategy Tester button in the Standard Toolbar), you will see two tabs – Setting and Journal, although other tabs will appear as you progress through the process.

Step 2: Setting the Parameters

This is where you can choose the parameters for your EA, including factors like currency and initial deposit volume. You can also set the types of positions, including long, short, only long and only short. You can set each parameter by the highest or the lowest value of the said parameter. Some of these include:

  • Balance
  • Profit Factor
  • Expected Payoff
  • Maximal Drawdown
  • Drawdown Percent
  • Custom

The Custom parameter allows you to input custom values to optimise the EA. To set the testing parameters, you need to go to the Settings tab mentioned above and then select:

  • Expert Advisor: You will find a dropdown menu that lists only the compiled EAs.
  • Expert Properties: Following the selection of the EA, you need to click this button to select parameters for three separate tabs, i.e., Testing, Inputs and Optimisation.
  • Symbol and Period: This is where you can choose the symbol and timeframe. In case there isn’t any historical data available for a specific symbol or period, the Tester will download the last 512 horizontal bars automatically.
  • Model: There are three methods of modeling historical data that you can choose from for testing:
  1. Open prices only – This is the quickest method for EAs to control bar opening.
  2. Control points – These are the results, although they are seen as estimates.
  3. Every tick – This is considered the most accurate method, since it uses a huge amount of tick data. However, it is usually slow and impact your computer’s operation.
  • Use Date: You will need to fill in the To and From fields to set a range for the historical price data that the test will use.
  • Optimisation: Check if the EA parameters are in optimization mode, if not, enable them, otherwise the EA will be tested but not optimised.
  • Open Chart: This will use the symbol you had earlier selected to open a new price chart to show trade entries and exists. However, this can be opened only after you have completed the testing of the EA.
  • Modify Expert: If you wish to, you can open MetaEditor and make changes to the code.
Step 3: Start Optimisation

All you need to now do is click on the Start button to begin the process of testing and optimisation. A window will open that, at the bottom, shows you the progress being made. MetaTrader will run several passes, testing and optimising the EA through different inputs of the same data. However, you will need to choose the variables on which the EA will be optimised by using the Expert Properties button on the Tester Window. A new window will open when you do this, from which you need to choose the Optimisation tab. Once you have chosen the variables, click on OK for the process to proceed.

Once the process is complete, click on the Optimisation Results tab to see the final report, which includes information on each pass made during the process. You can also choose to save the report.

Reading all these steps may make it seem more complicated to optimise your MT4 EA than it actually is. The great thing about technology is that it becomes more and more user-friendly and MetaTrader know what they are doing. They will take you seamlessly through the entire process of optimisating yout EAs, although it is a good idea to know what parameters you should choose to suit your trading needs and strategy.

Disclaimer

If you liked this educational article, please consult our Risk Disclosure Notice before starting to trade. Trading leveraged products involves a high level of risk. You may lose more than your invested capital.