Discussion of article "Genetic Algorithms - It's Easy!" - page 14

 
Good afternoon!
I read the article about using genetic algorithms. Very impressed!!!

I have several questions about the use of the ZigZag indicator, but the most important one is how do you give signals from the indicator for training?

the indicator has a variable step.
Thanks in advance.
 
Debugger:
1) I read the article about the use of genetic algorithms. Very impressed!!!

2) How do you feed signals from the indicator for training?

3) The indicator has a variable step.

I apologise for my slight correction of your message. I hope for your understanding. Thank you in advance. :)

So:

1) Thank you.

2) I'm not pitching it in any way. The article searches for extrema of Alternative ZZ, and compares the total profit in pips with the profit of the ZZ indicator (which is pre-set by a special script for the maximum profit taking into account the spread).

3) And it does not matter for demonstration of UGA capabilities. :)


ZЫ. If I have not covered your questions fully enough, ask more - I will try to help you to the best of my ability (or those who have already understood the work of the UGA algorithm will answer).

 

Great article, just looking for something similar.

One clarification:

3.10 GenoMerging. Заимствование генов

This GA operator has no natural equivalent

That's not entirely true.

This process in nature is called horizontal gene transfer.

In general - respect and respect to the author, only it is necessary to wrap this library in a class, to ensure mobility of use.

From remarks about conversion of bool to double - does it increase the amount of calculations ?

As I understood, for all genes the same range of variation and the same accuracy are set. The range - does not play a special role, any desired range can be "squeezed" into the required one. But the accuracy is more difficult, it has to be taken to the maximum. And if you need to search 1000 different values for some variable, the same range of search will be automatically assigned to all other variables, even bool variables. Won't it happen that the algorithm will spend quite a large part of computational resources to calculate the values of such a variable? Say, if we have a bool variable, a range from -10 to 10, and a precision of 0.1 - it turns out that for the algorithm on this variable there will be one hundred DIFFERENT "true" values and 100 DIFFERENT "false" values, giving the same two values of the fitness function. In addition, the population itself may contain many different individuals that differ on this variable according to the algorithm itself, but are the same because the real value of double is a bool.

Shouldn't we introduce one more array, at least setting the precision for each gene?

 
Laryx:

1- Great article, just looking for something like this.

2. As I understood, for all genes the same range of variation and the same accuracy are set. The range is not important, any desired range can be "squeezed" into the required one. But the accuracy is more difficult, it has to be taken to the maximum. And if you need to search 1000 different values for some variable, the same range of search will be automatically assigned to all other variables, even bool variables. Won't it happen that the algorithm will spend quite a large part of computational resources on calculating values of such a variable? Say, if we have a bool variable, a range from -10 to 10, and a precision of 0.1 - it turns out that for the algorithm on this variable there will be one hundred DIFFERENT values "true" and 100 DIFFERENT values "false", giving the same two values of the fitness function. In addition, the population itself may contain many different individuals that differ on this variable according to the algorithm itself, but are the same because the real value of double is a bool.

3. Shouldn't we introduce another array at least specifying the precision for each gene ?

1. Thanks.

2. The article keeps the algorithm as simple (open source project) as possible for the reader's ease of understanding. It is a starting point for improvements and embellishments as desired.

3. Of course, I myself use a customisable step (precision) for each gene (closed project).

 

This GA development certainly deserves honourable attention).

And even more so, since unlike MT4 in MT5, optimisation is possible only up to the penultimate day. Taking into account this nuance, this topic will be more and more relevant for users and developers of neuro-advisors. And of course, there is no doubt that genetic algorithms are as inseparable from the mathematical models of neural networks as the left from the right shoe).

So I would like to ask a question. Andrei, tell me, based on those tests and experiments (and I have no doubt that you have done enough of them), what in your opinion, and in relation to your EA (and maybe not only to yours) gives the best results in optimisation? Your GA or the internal GA of the terminal?

Thank you in advance for your answer.

 
wiantin:

...what in your opinion, and in relation to your EA (and maybe not only to yours) gives better results in optimisation? Your GA or the internal GA of the terminal?

My GA has better results. It is more customisable.

And the latest versions implement multi-criteria search with elements of elite selection.

But the in-house optimiser is also very good, if it had more settings and multi-criteria search, it would be worth nothing.

 
joo:

And the latest versions implement multi-criteria search with elements of elite selection.

Is there any possibility to familiarise yourself with them?
 

array out of range in 'UGAlib.mqh' (264,24)

when reaching 1000 genes. I don't understand how to increase the allowed number of genes, hint who knows better in libraries.

upd the error began to appear not only when increasing the number of genes...

upd 2 figured it out, the matter is not in the library, mql5 does not accept arrays of the sizes I set.

 
wiantin:
Is there any way to familiarise yourself with them?
No. Only if I think of writing a follow-up article.
 
ozer-man:

array out of range in 'UGAlib.mqh' (264,24)

when reaching 1000 genes. I don't understand how to increase the allowed number of genes, hint who knows better in libraries.

upd the error began to appear not only when increasing the number of genes...

upd 2 figured it out, the matter is not in the library, mql5 does not accept arrays of the sizes I set.

The error is due to the fact that the size of the second dimension is fixed array[][const].

To get away from this limitation you need to use structures (or classes), something like this:

struct Сhromosome //chromosome
  {
    float Gene[]; //genes.
  };
Сhromosome Population[]; // Population


ps. and how come I missed two whole posts. :)