Download MetaTrader 5
To add comments, please log in or register
Your broker does not support mobile MetaTrader 5? Ask him to buy them!
VabRus
100
VabRus 2015.09.28 17:16 

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
13605
whroeder1 2015.09.28 17:54  
The initial population is created from your external variable ranges.
VabRus
100
VabRus 2015.09.28 18:23  
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