Table of Contents
Optimization
It is discussed how to use and read the optimization results calculated by MetaTrader.
How to use the eaOPT
The eaOPT is an expert advisor that helps in recording the performance of each set of parameters of any expert advisor throughout the year.
Create the optimization report
As soon as eaOPT is launched it shows all the directories in the MetaTrader /Files
folder (see figure 1).
Tip: it's a good idea to organize the folders by year and, for each year, by expert advisor. It's also advisable to keep the same input setting every new year so that comparisons can be made.
As an optimization method, only the “slow” one (see figure 2) will be used so that every time it is executed all combinations will be evaluated.
Every year, for each month, the optimization has to be run from January 1st up to MM.01, where MM is the current month (see figure 3). The input values must be kept always the same.
The optimization reports have to be exported as an XML file and saved in the right folder (see figure 4).
At this point, the procedure to extract the data varies depending on if the relative CSV file already exists:
- no CSV file: select the reports, in chronological order;
- otherwise: first, select the CSV file, and then the new report.
Finally, press the “Extract” button.
To view only the CSV file, once it is selected, press the “Extract” button.
In the CSV file, the performance of each set of parameters is saved as comma-separated values of result and profit, since the beginning of the time span selected for the optimization:
[set][result_1,profit_1][…][result_n,profit_n]
Then, eaOPT rewrites these data in terms of monthly and average percentages:
[set][avg_percent][percent_1][…][percent_n]
Where:
[set]
: combination of parameters tested;
[result_n]
: balance at the end of the n-th month calculated from 01.01;
[profit_n]
: net profit at the end of the n-th month calculated from 01.01;
[percent_n]
: percentage monthly profit ([result_n] - [result_n-1]) / [result_n-1] * 100
;
The expert advisor eaOPT allows to save in the CSV file the input settings used for the optimizations. Regarding the data, it's possible to highlight a particular combination of parameters or sort in ascending order each column, just by clicking on it.
Read the optimization report
The “Average” column shows the monthly average profit, in percentage, based on the first MM months specified in the above spinbox.
Every new MM month will be chosen that combination of parameters whose monthly average profit was the maximum in the previous MM - 1 months (see table 1).
Info: this process of selection of the optimum set of parameters, in general, produces less profit than simply choosing a combination of parameters for the whole year because the former is supposed to close all open positions at the end of each month.