Skip to main content
Version: 2.0

General Notes

Using of SET files

A SET file is an inherent feature of MetaTrader. This file type can be saved and loaded before executing an expert advisor application with the strategy tester or on a live chart. The primary function of a set file is to store input parameters. In the Expert Advisor Builder context, a SET encompasses the complete model and parameterization of a trading module. You can utilize the dialogue depicted in the image below to load or save a SET file with MetaTrader 4 and MetaTrader 5, depending on your version.

Loading of set files.png

All the input parameters for the Expert Advisor Builder can be conveniently encapsulated in a single SET file. Each test run will generate A SET file in the Completed output folder. It's important to note that the input for the Expert Advisor Builder can be a SET file; similarly, its output is also a SET file. This facilitates the replication of previously executed configurations. A SET file can be stored anywhere on your hard drive, such as in a Dropbox or Google Drive Drive folder.

The SET file comprises as many lines as there are input parameters displayed in the MetaTrader input dialog. Each parameter has a corresponding line. This user manual provides a detailed explanation of every input parameter, presenting them in a table that shows how they appear in your MetaTrader inputs window and the SET file. As demonstrated below, the lines in the SET file and the strategy tester input parameters correspond to this documentation.

Manual modification of set files.png

Therefore, you have two alternatives for configuring your Expert Advisor Builder. The first option involves using the MetaTrader tester inputs window, and the second entails maintaining a SET file and loading this SET file. The second option enables you to manage the entire process via a script and MetaTrader's INI file.

Difference tool

In software development, using a helper tool to highlight differences between two texts is standard practice. This can be particularly useful when analyzing changes made in comparison to the default settings of the Expert Advisor Builder. The default configuration can be restored at any time using the input dialogue.

Difference tool for visualizing changed parameters.png

KDiff3 is a highly recommended freeware tool for this purpose. This tool can be downloaded from the provided link. If you need more clarification about what input parameters have changed, you can compare a SET file to the default inputs. The default SET file can also be downloaded from here. This approach allows you to identify and understand any configuration changes quickly.

Reproducing charts

Thanks to the feature that allows an entire trading module to be defined with just one SET file, it's easy to reference a data source to reproduce an example. You'll notice tip notes typically found below chart examples. With the link provided in the note, you can download a ZIP file containing all SET files needed to reproduce the example.

Reproducing a chart example with set file package.png

Some example charts consist of multiple screenshots; in this case, an input SET file is provided for each screenshot. The examples in this user manual are intended to be something other than ready-to-use trading systems. Instead, they aim to illustrate the minimal parameter changes required to highlight the explained feature. It's recommended to use a difference tool to identify the changes quickly. Whenever you want to test the effect of an input parameter, use the provided SET file package. As you see, this user manual heavily promotes a learning-by-doing approach.

Tester folder

The Expert Advisor Builder output folder remains consistent across all MetaTrader instances in which you use the application. The output folder is the same whether you're testing with MetaTrader 4 from broker A or MetaTrader 5 from broker B. To access the output folder with your Windows file explorer, enter the path provided below.

%AppData%\MetaQuotes\Terminal\Common\Files\FEA Trading Tester Data\Expert Advisor Builder 2.0

The Completed output folder is updated each time a strategy test is initiated. The Journal, Screenshot, and Statistic folders are rebuilt for every test run. Their content is refreshed when a trade is opened or closed.

Expert advisor builder output folder.png

For a detailed explanation of each output folder, please refer to the following articles:

Enabling and disabling of signals

Every signal generation block has a main switch that can turn the entire functional element off and on. The concept diagram shows that various signal generation blocks can be utilized. Some blocks even contain multiple independent submodules. For instance, although represented by a single function block in the concept diagram, the chart analyzer comprises four chart analyzer engines.

If there's a need to turn off chart analyzer CA1 temporarily, this can be easily achieved by turning off its corresponding Signal in use the input parameter. A list of all Signal in use parameters can be found in the relevant section.

The final trading signal is a logical AND conjunction of all enabled signal blocks. A final trading signal will be forwarded to the order configurator if each sub-signal is evaluated as positive.

Input variable within MetaTrader
(Identifier in SET file)
Default valueComment
> (INA1) CONF, Signal in use
(IN_enmIna1SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (INA2) CONF, Signal in use
(IN_enmIna2SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (INA) CONF, Signal in use
(IN_enmInaSignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (INB1) CONF, Signal in use
(IN_enmInb1SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (INB2) CONF, Signal in use
(IN_enmInb2SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (INB) CONF, Signal in use
(IN_enmInbSignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (OSA1) CONF, Signal in use
(IN_enmOsa1SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (OSA2) CONF, Signal in use
(IN_enmOsa2SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (OSA) CONF, Signal in use
(IN_enmOsaSignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (OSB1) CONF, Signal in use
(IN_enmOsb1SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (OSB2) CONF, Signal in use
(IN_enmOsb2SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (OSB) CONF, Signal in use
(IN_enmOsbSignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (CA1) CONF, Signal in use
(IN_enmCa1SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (CA2) CONF, Signal in use
(IN_enmCa2SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (CA3) CONF, Signal in use
(IN_enmCa3SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (CA4) CONF, Signal in use
(IN_enmCa4SignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (CAS) Signal in use
(IN_enmCasSignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (PAS) Signal in use
(IN_enmPasSignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON
> (FIS) Signal in use
(IN_enmFisSignalInUse)
OFFNumeric values usable in SET files:
0 - OFF
1 - ON

If a signal generator is not working as intended, it's recommended to double-check these settings first.

Abstraction of a trade

A trade can be separated into its essential components, often referred to in this documentation as follows:

  • Take Profit - TP
  • Stop Loss - ISL
  • Initial Take Profit Difference - ∆ITP
  • Initial Stop Loss Difference - ∆ISL
  • Opening
  • Closing

These values constitute the entirety of a trade. Depending on the execution type, the take profit and stop loss might be interchanged, as shown in the subsequent illustration.

Abstraction of stop loss and take profit.png

Particular attention is given to the initial stop loss difference. This value is determined by the difference between the price at opening and the initially configured stop loss value. Whether the trade direction is short or long, this difference value consistently represents the unitless value 100. Based on this value, the price changes during the lifespan of the trade can be interpreted as relative value. For instance, when a risk ratio of 1.4 is to be realized, the take profit line is positioned at 240, starting from the initial stop loss. This concept is frequently used to make many features reusable, independent of the underlying timeframe or symbol. Additionally, it helps maintain a constant reference over several years. This approach avoids using pips as units because 140 pips in EURUSD represent something entirely different from 140 pips in indices like US500.

Chart view

When the Expert Advisor Builder is executed with the visual mode enabled, the strategy tester opens a chart view. This view displays all actions and the rapidly advancing price. A separate panel in the same chart shows the output of the inspector module, which maintains real-time statistics on current performance and drawdown.

Inspector view of expert advisor builder.png

Please note that having the visual mode open significantly slows down strategy tests. While the visual mode is recommended for the initial configuration of the trading strategy, it's advisable to turn off the visual testing mode when simulating extended periods with real tick data. Interestingly, even minimizing the strategy tester window by using the Windows menu bar can increase the test speed.

Strategy testing with latest events

One of the standout features of the Expert Advisor Builder is the news engine. This feature allows economic news events to be used directly as signals for automated trading systems in MetaTrader 4 and MetaTrader 5. Remarkably, this feature is also available during testing with the strategy tester!

Outdated news data warning.png

To facilitate this, the compiled executable file for the Expert Advisor Builder includes all news data dating back to December 2009. As a consequence of this approach, updating the entire application to conduct strategy tests with the most recent news is necessary. The Expert Advisor Builder will indicate this in the news data table if no offline news data is available. Therefore, if you encounter the above warning, please download the latest installer and reinstall the application. The installers are updated every month.

Examples collection

The Expert Advisor Builder comes with a collection of examples that users can refer to. These examples provide a practical demonstration of how to use the various features and functionalities of the tool. They serve as a valuable resource for understanding how to use the Expert Advisor Builder effectively to create and test trading strategies. The examples cover various scenarios and strategies, offering users a comprehensive guide to navigate the tool. By studying and experimenting with these examples, you can gain hands-on experience and insights into building customized trading strategies.