Expert Advisor Builder
Intro
The Expert Advisor Builder is a robust and advanced universal trading algorithm developed based on professional traders' feedback, adhering strictly to modern software development rules. This application aims to automate trading strategies fully. There are thousands of ready-to-use expert advisors available for MetaTrader. However, despite claiming uniqueness and profitability, most have a catch. Some use strategies with a statistical expectation value below zero (Martingale systems), some rely only on basic algorithms from the 90s and work only in the short-term, and most need to be adequately developed and tested. Therefore, this application introduces a significant change in the development of expert advisors.
It employs contemporary software principles of reusability and abstraction to simplify the development of an automated trading strategy in input parameters within your MetaTrader strategy tester. With the Expert Advisor Builder, anyone can automate numerous different trading strategies, whether you're a beginner who wants to verify the profitability of a trading strategy or a professional fund manager who wants to implement multi-currency and multi-timeframe hedging strategies with a news feature involved.
A wide range of possible trading signals and management tools are available for automation, for example, indicators, oscillators, chart analyzers, news, candle search patterns, Fibonacci search patterns, and chart patterns. A signal can be appropriately evaluated at any market condition with sophisticated filters for timing, performance, and drawdown inspection. With the help of advanced order management and features like stop loss trailing, dynamic take profits, and extended pending order functionality, your trading strategy is just minutes away from being automated. The complete block diagram for the Expert Advisor Builder can be found in the user manual.
This application can be used with MetaTrader 4 and MetaTrader 5. For some use cases, sketching a simple strategy with the MetaTrader 4 strategy tester might make sense, but using the MetaTrader 5 version is generally recommended. You can find more about how to run a test in a detailed article.
Installation
The Expert Advisor Builder installer can be downloaded with the web-based downloads portal. You can find all the required steps on the checkout page if you still need to subscribe to the creator plan. The subscription is accessible to all for a nominal monthly fee, regardless of whether you're a novice or a professional. The goal is to make professional trading software accessible to everyone, and this cost-effective plan is the initial step toward that objective.
While downloading the installer, some browsers may prompt a warning and inquire if you wish to keep EXE files - please opt to retain this one!
Upon completion of the download, you can initiate the installation. To accomplish this, please double click on the setup file. A few users might encounter a warning from Windows when executing an EXE file. This warning can be overlooked by clicking More info and opting for Run anyway. It is aimed to resolve this issue shortly, but in the meantime, you can adhere to the workaround provided in the illustration below. Please continue with the setup and adhere to the instructions provided. During the installation, you'll be prompted to select the MetaTrader instance on your computer where you wish to install the Expert Advisor Builder.
The Expert Advisor Builder is now primed for use with your MetaTrader strategy tester!
Overall concept
This section briefly overviews the function principle behind the Expert Advisor Builder. Perfecting this principle took several years, making explaining it in a few words challenging. Please consider reading the extended article about the overall concept for a comprehensive understanding.
However, the overall concept can be summarized in two sentences:
- The Expert Advisor Builder is used to develop a trading module and to generate an output file containing all information about the module.
- The Custom Expert Advisor executes the output files the Expert Advisor Builder produced.
As evident, both applications work in tandem! However, for some use cases, the Expert Advisor Builder suffices. For instance, if you only want to validate a trading idea that you will eventually execute manually, you can test the strategy upfront in the strategy tester. In contrast, to execute a trading strategy completely autonomously, you must subscribe to a Custom Expert Advisor plan and use the output files as input for this application.
This principle might be familiar from other development processes. For example, a designer uses an editor application in CAD development to model and export an output file containing the 3D model. Analogously, the editor application is the Expert Advisor Builder, and the SET files represent the 3D model, respectively, its export file. After the designer has developed the 3D model, he might want to produce it with a 3D printer. The 3D model then serves as input for the 3D printer to create a physical object. In this case, the 3D printer is the Custom Expert Advisor, which can use the output files from the Expert Advisor Builder and execute one or more so-called trading modules. A single SET file defines an entire trading module.
The illustration below visualizes the concept.
Looking at the Custom Expert Advisor in this illustration, you can see that two variants of this application exist - a live variant and a tester variant. Both perform the same task but use different input folders. Therefore, the live variant is exclusively responsible for executing live charts, and the tester variant is accountable for validating trading strategies with the strategy tester. This ensures the input and output data separation to avoid interference.
Just as a 3D printer can print multiple objects simultaneously, the Custom Expert Advisor can execute various input files simultaneously. In addition to that, each trading module can be turned on and off while the Custom Expert Advisor is active. This helps maintain a continuous trading journal and adequately inspect the drawdown and performance.
This unique principle of separation of expert advisor development and execution opens up an almost unlimited range of possibilities. The most interesting by far are self-adapting trading systems that turn trading modules on and off with the help of a feedback loop. Every aspect of the Expert Advisor Builder and Custom Expert Advisor is designed to be fully automated.
Since many trading strategies only work for a limited period, finding an algorithm-based system that operates profitably for an extended period is challenging. This means trading strategies have to be adapted continuously. Depending on the timeframe, it can sometimes be commonplace. Using the Expert Advisor Builder to improve this workflow, many different trading strategies for MetaTrader can be generated and evaluated quickly.
Execute an example
The Expert Advisor Builder needs to communicate with a backend server, which means you must modify some settings in your MetaTrader. Please launch the MetaTrader instance you selected during setup and visit the Options menu.
From there, navigate to the Expert Advisors tab and enable the Allow automated trading and Allow DLL imports options. Despite the warning for the second option, there's no cause for alarm. While operating, the application uses native Windows libraries to communicate with a backend license server, making license management more accessible through a web interface.
The Expert Advisor Builder can only be used when the account information matches with the one connected to your subscription. Thus, ensure that you're logged in with the correct trading account. As previously stated, the Expert Advisor Builder is designed to run exclusively with the strategy tester. It will issue a warning if you try to add it to a live chart. Therefore, it must be used with the strategy tester. To do this, open the strategy tester under View - Strategy Tester. This is shown as an example with MetaTrader 4 in the image below.
You can locate the executable in the dropdown menu of the strategy tester settings under FEA Trading\MT4\Expert Advisor Builder 2.0 if you're using a MetaTrader 4 instance or FEA Trading\MT5\Expert Advisor Builder 2.0 in case you're using a MetaTrader 5 instance. Both versions function identically.
Most examples can be executed in any timeframe and on any symbol. However, please set EURUSD as the symbol to be tested, M15 as the timeframe, select Open prices only (MetaTrader 4) or 1 minute OHLC (MetaTrader 5) as the data model, and the previous four weeks as the test period. Finally, enable the visual testing mode.
You can now configure the input parameters by clicking on Expert properties (MetaTrader 4) or Inputs (MetaTrader 5).
The Expert Advisor Builder includes numerous examples that can be selected immediately in the inputs menu. Additionally, each example has its dedicated article in this documentation. These examples cover a broad range of functionality and can serve as a starting point for your development of a professional trading system.
To proceed, please select example No.29: News trading of regional high impact calendar events from the dropdown menu, confirm the inputs by pressing OK, and start the test run with Start.
The underlying algorithms are designed for optimal execution speed. Simulating the test period with the recommended tester settings should take a few minutes. However, strategy testing can take longer depending on the timeframe and data model. This is a common occurrence in modern strategy testing. Upon completion, you should see a chart that resembles the following.
The just executed example showcases the news trading capability of the Expert Advisor Builder. As you can see, a long order is placed whenever a high impact event containing ECB or FED in its title occurs in EUR or USD economic areas.
Configure a simple trading strategy on your own
Next, you'll construct a custom trading module by adjusting some input parameters to create a strategy that responds to signals generated by a Bollinger Band indicator. Remember that none of the examples in this documentation are intended to be ready-to-use trading strategies. Each strategy necessitates appropriate adaptation and fine-tuning to the timeframe and symbol.
Reset of input parameter
To proceed, please reset the input parameters. This may appear differently depending on the version of MetaTrader you're using. Below is an illustration of resetting the input fields with MetaTrader 4 and MetaTrader 5.
Let's move on to configuring the Expert Advisor Builder. You'll notice that with just a few tweaks, the same algorithm will implement a completely different strategy.
Input parameter configuration
Please refer to the table below to adjust your Expert Advisor Builder's input parameters.
Input variable within MetaTrader (Identifier in SET file) | Example value | User manual chapters |
---|---|---|
> (OUF) Idea output description (max 63 characters) (IN_strOufIdeaOutputDescription) | No.35: Indicators - Bollinger bands example | Output Folder |
> (INA1) CONF, Signal in use (IN_enmIna1SignalInUse) | ON | Configuration Available Indicators and Default Values Example |
> (INA1) CONF, Selection (IN_enmIna1Selection) | BB - Bollinger Bands | |
> (INA1) CONF, Line index (IN_nIna1LineIndex) | 1 | |
> (INA2) CONF, Signal in use (IN_enmIna2SignalInUse) | ON | |
> (INA2) CONF, Selection (IN_enmIna2Selection) | SMA - Simple Moving Average | |
> (INB) CONF, Signal in use (IN_enmInbSignalInUse) | ON | |
> (INB) COND, Relation 1 INB1 to INB2 (IN_enmInbRelation1) | VALUE 1 CROSS VALUE 2 | |
> (INB1) CONF, Signal in use (IN_enmInb1SignalInUse) | ON | |
> (INB1) CONF, Selection (IN_enmInb1Selection) | BB - Bollinger Bands | |
> (INB1) CONF, Line index (IN_nInb1LineIndex) | 2 | |
> (INB2) CONF, Signal in use (IN_enmInb2SignalInUse) | ON | |
> (INB2) CONF, Selection (IN_enmInb2Selection) | PRICE - Price directly from series |
Execution of strategy test
Next, please restart the strategy test by pressing Start again. Using the same tester setting as in the previous example is suggested. Then, after a few minutes, you should see a chart similar to the one below.
You may have already noticed that the chart window is divided into three sections: the chart itself and two oscillator windows. Depending on the indicator or oscillator you chose, the two subwindows will be used to visualize the values and angles. Using the Expert Advisor Builder, you'll never have to deal with an external .mq4 or .mq5 indicator file again. Every indicator and oscillator is natively integrated into the algorithm. This not only makes it easy to switch between indicators, but it's also swift and efficient!
As you can see, over the course of this getting started article, you've already executed one example trading module and created one on your own without writing a single line of code.
File output - Trading journal
The Expert Advisor Builder maintains a versioned trading journal for each test run within its output folder. You can find more information about the output folders in the user manual. For now, let's concentrate on the automatically generated journal file. There are several ways to access the output folder of the Expert Advisor Builder. As shown in the image below, you can find a shortcut in the Windows start menu and on your desktop to open the tester folder for all applications.
Alternatively, you can enter the following line into your Windows file explorer path to access the journal output folder of the Expert Advisor Builder directly.
%AppData%\MetaQuotes\Terminal\Common\Files\FEA Trading Tester Data\Expert Advisor Builder 2.0\Journal
In both scenarios, you will encounter the following folders. Please navigate as shown in the illustration until you find the Excel file Journal Evaluation. The raw output format produced by the Expert Advisor Builder is a CSV file, which can be used with the Journal Evaluation Excel file.
Open the Excel Journal Evaluation file and follow the steps found in the import sheet. Since this Excel file uses VBA scripts to import and prepare the journal data, you must enable this feature. Please accept the security warning that will appear when you open the file for the first time.
The automatically generated trading journal contains a wealth of information. The most critical data are conveniently displayed in diagrams that update after each import. For instance, the illustration below shows the equity diagram, which will be the same as the strategy tester typically generates.
File output - SET file
As stated, the Expert Advisor Builder stores all information defining a trading strategy within a SET file. You can locate this in the Completed folder by navigating down the tester folder structure as instructed below.
Alternatively, please enter the following path in the Windows folder browser to access the output directly, which contains the latest SET file.
%AppData%\MetaQuotes\Terminal\Common\Files\FEA Trading Tester Data\Expert Advisor Builder 2.0\Completed\Single\EAM_I1
The application distinguishes between output data generated by a regular test (Single) run and an optimization test run (Optimization). In this case, you can find the generated SET files in the Single folder. A SET file is a regular text file that can be opened and edited with any text editor. This file can be loaded with the strategy tester to adjust the input parameters or used as input for the Custom Expert Advisor.
Let's conclude the getting started article here. As you can see, the Expert Advisor is a powerful tool to automate various trading strategies quickly and without the need to learn to code. If you want to delve into each detail, please continue with the user manual: