Testing and optimization of Expert Advisors is performed using the so called agents —special services that perform calculations. There are three types of agents:
All agents are shown in a table divided into two parts - local and remote agents:
- Agent — name of the agent. Agents are named automatically according to the number of the logical core;
- Hardware — this column contains information about the type of the processor, CPU clock, RAM size and internal performance rate (the higher the rate is, the the more powerful the hardware is);
- Tasks — number of test runs performed by the agent during the current process of optimization.
- Progress — progress of testing performed at the agent;
- Status — the status of the agent: busy, ready, unavailable.
Press " Select" in the context menu to select one of the agents that will be used in testing (one-time run). During optimization, calculations are distributed among agents automatically.
Any agent can be disabled. For example, if you test and optimize on a notebook, you can disable local agents. To do this, go to the agent setup by pressing " Edit". In the appeared window remove the check mark from the "Enable" field. Disabled agents are marked by icons and .
If testing/optimization is not finished manually (by pressing the Stop button at the settings tab or by closing the client terminal), the processes of used local agents are not unloaded from the computer memory for 5 minutes.
This feature allows avoiding delays connected with preparing the price history and starting the agent processes when re-testing/re-optimizing the same Expert Advisor at the same symbol, timeframe and time period.
Local agents are installed automatically with the client terminal. The number of available local agents (started on the computer where the terminal is installed) is equal to the number of logical cores of the processor. They are created automatically.
Only local agents that can be used only by the terminal Strategy Tester are installed during the terminal installation. Remote agents that can also be connected to the global MQL5 Cloud Network are installed only manually.
A remote agent is a specialized service installed on any computer and used for testing and optimizing Expert Advisors in the strategy tester. The tester allows working with the unlimited number of remote agents using all available computation powers. All you need for using an external agent is knowing the address and port for connecting to it, and its password.
Special MetaTester application should be used, if you want to install remote agents on your computer. Only local agents are installed during the terminal installation.
Remote agents can be used in 64 bit systems only.
To save traffic and disk space, as well as for security reasons:
- on remote agents, messages of Expert Advisors (Print() function), as well as the messages about trade operations, are not recorded to the Journal;
- DLL call is prohibited on remote agents.
In order to add an external agent, click " Add" in the context menu of the remote agents section. As soon as you do it, the wizard of adding agents will appear:
Currently this wizard allows adding agents in two ways: by specifying an IP address or domain name, or by importing from a file:
- Add agents from host
In this case you need to specify an IP address or domain name of a server where agents are installed, as well as the range of ports and password for connecting to the agents.
- Scan network
In this case you need to specify a range of IP-addresses and ports that should be scanned, as well as the password for connecting to the agents. As soon as you press the "Next" button, the specified network range will be automatically scanned for installed agents.
- Import from *.mt5 file
If you select this option and click the "Next" button, the window of specifying a *.mt5 file to import agent from will be opened.
For a remote agent, you can add one of local ones installed using the MetaTester component. This can be used if some power reserve is left on the processor cores during calculations. Thus, you can increase their load.
The list of agents to be added is displayed at the next step:
The parameters of agents are displayed here. To add the agents, click the "Finish" button.
In order to change settings of an agent, execute the " Edit" command in its context menu. The following window will appear after that:
The following fields are available here:
- Name — name of the agent;
- Address — IP address and port for connecting to the agent, separated by a colon;
- Password — password for connecting to it;
- Enable — this option allows to enable or disable the agent.
In settings of local agents only the option of enabling/disabling them is available.
Import and Export of Settings of Remote Agents
To make setting up of remote agents easier, the feature of importing and exporting of their settings is implemented in the client terminal. The files of settings have the *.mt5 extension. The import and export commands are located in the context menu of the "Agents" tab.
Files of settings have the following format: Name;Address:port;Password;Description;Enable.
- Name — name of an agent;
- Address:port — IP address and port for connecting to an agent, separated by a colon;
- Password — password for connecting to it;
- Description — description of hardware an agent works on;
- Enable — mode of an agent operation: 1 — agent is enabled, 0 — agent is disabled.
Settings of different agents are separated from each other with line breaks.
MQL5 Cloud Network Agents
Under the list of local and remote agents, you can find the list of agents that belong to the cloud computing network — MQL5 Cloud Network:
Advantages of the MQL5 Cloud Network
The MQL5 Cloud Network allows you to quickly optimize your Expert Advisors using the power of thousands of computers. The network combines remote agents and distributes optimization tasks among them. The Strategy Tester connects to the cloud network through multiple access points, which are distributed on a territorial basis (e.g., MQL5 Cloud Europe). For each access point, the number of agents currently connected to it is shown.
- In addition to using the MQL5 Cloud Network, you can provide your CPU computing power in the network. To install the remote agents and include them in the network, use a special utility "MetaTester".
- Read more about the MQL5 Cloud Network on the official site.
- The entire power of the MQL5 Cloud Network is used only for Complete slow optimization.
- During genetic optimization, only agents of one access point are used. It is connected with the specific features of the genetic algorithm.
- The genetic optimization mode is automatically enabled when the total number of optimization steps exceeds 100 million.
Use of the MQL5 Cloud Network
To start using agents of the network, enable them using the " Enable" in the context menu. Since the MQL5 Cloud Network is a paid service, a user must have an account at the MQL5.community website, through which all the accounting operations are performed. The account details should be specified at the "MQL5.community" tab in the terminal settings.
- MQL5 Cloud Network can be used in 64 bit systems only.
- Using agents of the MQL5 Cloud Network is paid. The formula for calculating the cost is described in a separate section. The current MQL5.community account balance is displayed above the list of cloud agents.
- To use MQL5 Cloud Network a user need to have at least 1 US dollar on the MQL5.community account. Tasks are passed packaged to several access points simultaneously, and the user should be able to pay for completion of that tasks. The Network is not able to preliminarily define the time and resources required for calculation of the tasks.
If the details of an MQL5.community account haven't been specified before enabling the MQL5 Cloud Network agents, the following window is shown:
In this window, you should specify the details of your account at MQL5.community. If you're not registered yet, use the corresponding link to create a new account.
The following commands can be executed from the context menu of the "Agents" tab:
- Select — enable the default use of a selected agent for testing;
- Allow to Use — open the submenu for group managing of agents:
- Local Agents — enable/disable all local agents;
- Remote Agents — enable/disable all remote agents;
- MQL5 Cloud Network — enable/disable all agents that belong to the MQL5 Cloud Network;
- Add — open the window of external agent addition;
- Edit — open the window for editing the selected agent;
- Delete — remove a selected external agent;
- Enable — enable a selected agent or a group of agents. To work with a group of agents, select them holding the Shift or Ctrl key;
- Disable — disable a selected agent or a group of agents;
- Import — import the settings of remote agents from an external text file;
- Export — export the settings of remote agents to an external text file;
- Animation — enable/disable the animation of CPU loading by agents. The animation should be disabled if you have a lot of agents; it allows saving CPU resources;
- Auto Arrange — enable/disable automatic arrangement of the column size;
- Grid — show/hide grid to separate fields.