Optimized variables

The Optimizer’s purpose is to analyze reports of optimizations performed in MetaTrader4 and, at the same time, to make us able to select powerful and robust parameter sets. This means that the parameter sets obtained using the Optimizer are resistant to little market movements, thus avoiding losses.

The Optimizer screen is divided into several sections. The first of them shows, as a reference, the variables or parameters which were optimized in MetaTrader4.

Optimal number of clusters and rerunning KMeans

The Optimizer’s core is an artificial intelligence and machine learning algorithm which has the optimization results clustered. By default, the algorithm learns the optimal number of clusters, so there is no need to deduce it. However, if the user wishes to modify that number or test several of them, it can be modified and, after that, the analysis can be rerun by clicking on the Rerun k-Means button.

Analysis of objective function

This is the most important section of the optimization analysis, and it must be thoroughly observed. It provides us with the information needed to select the clusters with which we are going to trade or continue the development of our Expert Advisor. A special graph is shown. In it, every cluster is represented by means of a boxplot, containing a thick central part (the box) and two thin extreme parts (the whiskers). Ideal clusters have their box (even their bottom) up, no matter where the whiskers are placed.

In addition, for every cluster the best optimization result is calculated. This is called the centroid (represented by the small square in the graph). We must choose only those clusters which centroid is placed inside the box (preferably at the top) or on the upper whisker. We must never continue working with clusters which centroid is placed on the lower whisker and, ideally, neither should we with those placed at the bottom of the box.

Cluster properties

In this section, the values of every centroid optimized variables are shown, together with 7 performance metrics. In addition, these metrics are represented by means of a web chart. The larger the blue surface, the better the centroid.

The analyzed centroid can be changed employing the top arrows. Frequency analysis, explained below, is performed on the active cluster, as well.

Frequency analysis

These barplots show the frequency with which the performance metrics of the optimization results fall into cetrain precalculated intervals. The red bar corresponds to the most common interval, for the current cluster.

Exporting clusters to MetaTrader4

When clicking on the export button the set files for every cluster are created inside the MetaTrader4 tester folder. This way, they can be used both for backtesting and for demo/live trading immediately.