Time Handling

 

In MQL4 I could write:

 

MqlDateTime ttt;

actualDay = ttt.day_of_week;   //  MQL5 returns 0

 

 

In MQL5 this functioned:

 

MqlDateTime ttt;

    TimeToStruct(TimeCurrent(),ttt);
    myDay = ttt.day_of_week; 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Data Structures / Structure of the Date Type
  • www.mql5.com
Standard Constants, Enumerations and Structures / Data Structures / Structure of the Date Type - Documentation on MQL5
 
24h-worker :

In MQL4 I could write:

 

MqlDateTime ttt;

actualDay = ttt.day_of_week;   //  MQL5 returns 0

 

 

In MQL5 this functioned:

 

MqlDateTime ttt;

    TimeToStruct(TimeCurrent(),ttt);
    myDay = ttt.day_of_week; 

 

 


You could also make a function that does it the old way. 

Use the following include file:

Files: