Agents

Testing and optimization of Expert Advisors is performed using the so called agents special services that perform calculations. There are three types of agents:

Local

Remote (external)

MQL5 Cloud Network Agents

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 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 Edit". In the appeared window remove the check mark from the "Enable" field. Disabled agents are marked by icons Disabled local agent and Disabled remote agent.

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

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.

Remote Agents

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.

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.

Adding

In order to add an external agent, click "Add Add" in the context menu of the remote agents section. As soon as you do it, the wizard of adding agents will appear:

Adding Agents

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:

List of agents to be added

The parameters of agents are displayed here. To add the agents, click the "Finish" button.

Changing Settings

In order to change settings of an agent, execute the "Edit Edit" command in its context menu. The following window will appear after that:

Agent Setup

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:

MQL5 Cloud Network Agents

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.

Since the purpose of the MQL5 Cloud Network is to provide the most efficient use of resources of the network members, will not see all the available agents before starting the optimization process. If an agent does not perform tasks, it switches to the sleep mode. As soon as you start optimization, depending on the number of required passes, more and more agents will join the work:

Agents joining the MQL5 Cloud Network

Within 30-60 seconds thousands of agents will be available for you to perform your task.

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 one million in a 32-bit system and 100 million in a 64-bit system.

Use of the MQL5 Cloud Network

To start using agents of the network, enable them using the "Enable 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.

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 credit on the MQL5.community account. Task are passed packaged to several access points simultaneously, and the user must be able to pay for completion of that tasks. The Network is not able to calculate the exact cost as the time and resources required for calculations cannot be estimated precisely before the start of calculations.

If the details of an MQL5.community account haven't been specified before enabling the MQL5 Cloud Network agents, the following window is shown:

MQL5.community Account

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.

Context Menu

The following commands can be executed from the context menu of the "Agents" tab:

Select 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 Add — open the window of external agent addition;

Edit Edit — open the window for editing the selected agent;

Delete Delete — remove a selected external agent;

Enable 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 — disable a selected agent or a group of agents;

Import Importimport the settings of remote agents from an external text file;

Export Exportexport 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.

 

MetaTrader 5 — a complex trading platform for providing brokerage services on the retail Forex market.

Copyright 2000-2014, MetaQuotes Software Corp.