Previous  Next

Optimization Types

Two optimization types are available in the tester. You can select the appropriate one on the Settings tab of the Strategy Tester.

Slow Complete Algorithm

In this mode, optimization runs are performed for all possible combinations of values of input variables selected on the appropriate tab.

This method is the most precise one. However, running the Expert Advisor with all possible combinations takes much time.

Fast Genetic Algorithm

This type of optimization is based on the genetic algorithm of search for the best values of input parameters. This type is much faster than the first one and is almost of the same quality. The slow complete optimization that would take several years can be performed within several hours using the genetic algorithm.

Each individual has a specific set of genes which corresponds to the set of their parameters. Genetic optimization is based on the constant selection of the most "adapted" parameters (values that give the best result). In the general form, the algorithm can be represented the following way:

Number of Test Runs

During the genetic optimization, the number of test runs is much lower, which provides quickness of optimization. After the start of the genetic optimization, an estimated number of test runs is displayed on the Settings tab. It is calculated by the following formula:

Population size * (Unconditional number of generations + Number of generations for convergence estimation)

where:

  • If the total number of optimization steps exceeds 1,000,000 in a 32-bit system or 100,000,000 in a 64-bit system, the genetic optimization mode starts automatically.
  • During the genetic optimization, intermediate results are saved in cache after the calculation of each generation (in a file platform_data_folder/tester/cache/*.gen). Thus the optimization process can be interrupted at any time. Even if the process of genetic optimization is interrupted as a result of an external factor (for example, power failure), the optimization will be automatically continued from the last calculated generation at the next start. The genetic optimization cache is stored until the optimization settings are changed or the optimization process is completed.
  • At a regular optimization stop (when you press the Stop button) all the previously calculated runs are saved. When the optimization process is resumed, it continues from the last calculated run.

Optimization Criterion

An optimization criterion is a certain factor, which value defines the quality of a tested set of parameters. The higher the value of the optimization criterion, the better the testing result with the given set of parameters. Such a factor can be selected in a field to the right of "Optimization" on the Settings tab.

The optimization criterion is required only for the genetic algorithm.

The following optimization criteria are available:

Another option is to use "Complex Criterion max". This is an integral and complex measure of a test pass quality. It measures multiple parameters:

By using this criterion, you can see that the highest value of one parameter (for example the profit) is not always the best option in terms of the complex analysis. The complex criterion gradually selects the best passes: firstly, by the number of deals, then by the Expected Payoff, Recovery Factor, and so on. The new option allows reception of the best optimization passes according to all parameters. Furthermore, you can select the optimal pass based on the desired parameter, such as the highest profit.

All Symbols Selected in Market Watch

Unlike the above described optimization types, this one allows to test an Expert Advisor with the same input parameters, but with different symbols. Only the main symbol of testing is changed in each pass, i.e. the symbol of chart the EA would be attached to.

Optimization is performed only for symbols that are currently chosen in the Market Watch. So you can manage optimization by adjusting the set of selected symbols.

  • Please note that downloading of necessary price data from the server may take a long time. However, the slowdown of optimization as a result of data downloading occurs only during the first launch for a symbol, next time only the missing data is downloaded.
  • The current values of input parameters specified in the "Value" field are used for the optimization by symbols.