Question on genetic optimisation

 

I decided to start optimizing the TS, but since there are a lot of parameters to optimize - 13, and the TS is designed for M1 and there are no more than 10 trades per month, I decided to use genetic algorithm and take the history for 1 month.

At the first run the calculated time was more than 250 hours and the number of combinations was more than 83 billion. In the article "Genetic Algorithms in MetaTrader 4. A Comparison with the Optimizer's Direct Search" states that we should not focus on the calculated time as it does not correspond to reality in the genetic optimization, but the article was written long ago, maybe the latest builds of MT4 already correspond to it? So should I wait? I expected no problems with optimization when I created TS, but it turns out that TS seems to be good, but I cannot set it manually, there are too many parameters and small changes in them lead to the significant restructuring of the system.

Can you also tell me what the figures in the bottom left corner mean: the first one is the number of runs, in brackets - the number of combinations, and what is between them under / ?

 
Angela >> :

I decided to start optimizing the TS, but since there are a lot of parameters to optimize - 13, and the TS is designed for M1 and there are no more than 10 trades per month, I decided to use genetic algorithm and take the history for 1 month.

At the first run the calculated time was more than 250 hours and the number of combinations was more than 83 billion. In the article "Genetic Algorithms in MetaTrader 4. A Comparison with the Optimizer's Direct Search" states that we should not focus on the calculated time; it does not correspond to reality in the genetic optimization, but the article was written long ago, maybe the latest builds of MT4 already correspond to it? So should I wait? I expected no problems with optimization when I created TS, but it turns out that TS seems to be good, but I cannot set it manually, there are too many parameters and small changes in them lead to the significant restructuring of the system.

Please also tell me, what do figures in the bottom left corner mean: the first one is number of runs, in brackets - number of combinations, and what is between them under / ?

The numbers in genetics mean the number of combinations / combinations in genetics.

It is a kind of self-promotion to show how great MetaQuotesters we are and how much time we can save thanks to genetics.

\There are a lot of parameters to be optimised - 13\ I advise to divide the parameters into pairs and threes,

(here you will have to think what is paired with what) and do the selection in steps.

It is more convenient to look at a two-dimensional optimization chart that way.

In general, genetics picks scattered maxima and is still better to do simple search.

I personally use genetics to find a local area where I already do a full search.

 
Urain писал(а) >>

In genetics, the numbers refer to the number of quota/quota in genetics (direct sampling).

This is a kind of self-advertisement to show how cool we are as MetaQuotesters and how much time we save you thanks to genetics.

\There are a lot of parameters to be optimized - 13\ I advise to break the parameters into pairs and threes,

(you'll have to think about what's paired with what) and do the selection in steps.

It is more convenient to look at a two-dimensional optimization chart that way.

In general, genetics picks scattered maxima and is still better to do simple search.

I personally use genetics to search for a local area that I would then use to do a brute force search.

The problem is that most of the optimization parameters are related to each other by feedbacks and changing one causes restructuring of several others and the picture changes. The strategy is designed in such a way that the optimum will be sought throughout the entire hyperplane of the parameters used. So I will probably have to abandon this strategy, though it is a pity of course, running it on the history from 1.01.2007 up to now even without optimization the TS has showed stability, at least it hasn't fallen to zero, though it is designed for weekly overoptimization. In the last 2 years there have been cyclical ups and downs.

I will go to de-stress, and start working out a new strategy.

 
At the opening of the bar, try to optimise
 
83 billion might get you in the wrong place. As I understand it, a tester, if the total number of runs exceeds a certain number (and yours certainly does) in genetics does no more than 10,000 runs. That is, the tester may, after getting positive results somewhere in a huge space of variants, start crossing over to these results, and may simply not have time to look at really good results... You should try to increase the step of parameters. Then there will be fewer options. And then, after a first approximation, consider the area of greatest interest in more detail.
 
Angela >> :

The problem is that most of the optimization parameters are related to each other by feedbacks, and changing one leads to rearranging some of the others and the picture changes.

This is generally fine. So, through a two-dimensional optimization chart you can identify the correlation and spell it out via a coefficient in the code.

exclude one optimisation term altogether. For example, you notice that the maximum values on a 2D graph go diagonally.

This means that you can make one parameter dependent in the code ( x2 = x1 + 3 )and optimize only x1. Good luck.

 

I did not want to wait for the end of the optimization, so I turned it off. Although TS is stable and shows good results on profitable trades, but waiting for weeks for optimization is too much.

For example, here is the interval shown in the chart above but over the last two months.

Besides, I have a separate optimization of Buy and Sell. Besides, there are too few deals and because of bad Internet I was counting to switch off my trading system at night, while I could wait 2-3 weeks waiting for deals to be done.

So I removed stress yesterday and started to develop new TS. I will do more simple and 390 lines of code with logical conditions is too much, and brakes strongly, testing by opening prices since 2007 took 4.5 hours. In addition, in a month, I myself will not understand what is in these logical conditions nakochelya.

 
Angela >> :

Besides, in a month I won't even know what I've done in these logical conditions.

Write detailed comments. ;-). Since the TS is discarded, it may be published in codebase as an admonition, maybe refactoring can be done.

 

Making a new version of the TS. Made one block, and before proceeding I decided to optimise some parameters, so that I can further tune with more or less optimal initial settings. I optimized 7 parameters, estimated time of optimization - 106 hours, although after the optimization run it increases little by little, the number of combinations - 44,274,384, estimated number of runs - 10,496. Initially, I have set the history for 1 month, the optimization started, the results ofoptimization runs began to appear in the "optimization results" window. I got 186 deals during one month. I decided to halve the history to speed up the optimization, after the launch the time was 57 hours, but the windows "optimization results" and "optimization schedule" did not show anything, what is the problem?

 
Angela >> :

Making a new version of the TS. Made one block, and before proceeding I decided to optimise some parameters, so that I can further tune with more or less optimal initial settings. I optimized 7 parameters, estimated time of optimization - 106 hours, although after start of optimization it increases step by step, number of combinations - 44,274,384, estimated number of runs - 10,496. Initially, I have set the history for 1 month, the optimization started, the results of runs began to appear in the window "optimization results". I got 186 deals during one month. I decided to halve the history to speed up the optimization, after I ran the robot for 57 hours, but the windows "optimization results" and "optimization schedule" did not show anything, what is the problem?

1 Parameters in the "Optimization" window are probably set in the constraints, which no single run has overcome,

If there is no threshold winner, it means there is nothing to choose from. Leave one check mark next to "Maximum Profit",

If at least one run will overcome the barrier and give at least some profit, it will be displayed.


2 If you cannot reduce the number of parameters optimised at the same time, increase the step.

And then after seeing the result (in the field of what values) run with a smaller step.

For example: Per { start, step, end}

If x1 {10,10,100}, as a result, we will see a dark cluster on x1 from 60 to 80.

Do a second run with the parameters x1 {60,1,80} and find the optimum.

(When I speak of a graph, I mean a dimensional one.)

 
Angela >> :

>> what's the problem?

Who knows, miracles happen. Usually, before I run it for optimization, I make visual runs with intended parameters, displaying maximum required data in comment. I manage to see a lot of interesting things at once, as well as when reviewing the log. Bad history, indicator errors, Expert Advisor's errors, etc. After elimination of them there is more confidence in the accuracy of the optimization.

Reason: