Download MetaTrader 5

Any way for set a initial population in genetic algorithm?

To add comments, please log in or register
Interested in earning money via MQL5 Cloud Network? Enter your profile!
VabRus
105
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
14530
whroeder1 2015.09.28 17:54  
The initial population is created from your external variable ranges.
VabRus
105
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