Download MetaTrader 5

Any way for set a initial population in genetic algorithm?

To add comments, please log in or register
VabRus
105
VabRus  

Best regards 

 

I think is very important to set a initial population when we use the genetic algorithm like we could set in Matlab.

 

Only we must set external variables from code.

 

Like this:

 

int init()

  {

//----

     if(GlobalVariableCheck(initialPopulation) == false)

     {

        GlobalVariableSet(initialPopulation, 0.0);

        period = 184;  //not set 

        StartHour = 2; //not set

        EndHour = 8; //not set

        TPMin = 207; //not set

     } 

} 

 

or

 

void OnTesterInit() (not running in mql4)

{

         period = 184;

        StartHour = 2;

        EndHour = 8;

        TPMin = 207;

 }

 
whroeder1
15331
whroeder1  
The initial population is created from your external variable ranges.
VabRus
105
VabRus  
WHRoeder:
The initial population is created from your external variable ranges.
No, the value is random between external variable ranges.
To add comments, please log in or register