Download MetaTrader 5
To add comments, please log in or register
Unable to find the right application? Order it!
haidzatul Nazamri Rasda
139
haidzatul Nazamri Rasda 2010.04.16 22:21 

Any idea to use this function?

in MQL5 i use this

         MqlDateTime hari,jam ;

         Print("Day of Week =",hari.day_of_week);
         Print("Hour =",jam.hour);

the result

 Day of Week = 0

 Hour = 0

Actually i want to coding similar like this in MQL4, like this

  Print("Day of Week =",DayOfWeek()); 

 

help me? 

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
Paul
784
Paul 2010.04.17 10:18  
haidzatul posted  :

Any idea to use this function?

in MQL5 i use this

         MqlDateTime hari,jam ;

         Print("Day of Week =",hari.day_of_week);
         Print("Hour =",jam.hour);

the result

 Day of Week = 0

 Hour = 0

Actually i want to coding similar like this in MQL4, like this

  Print("Day of Week =",DayOfWeek()); 

 

help me? 

 

Your MqlDateTime line only declares the structure and you need another command such as TimeCurrent to populate it.  This is documented in the MQL5 editor help.

MqlDateTime hari;
TimeCurrent(hari);

Print("Day of Week =",hari.day_of_week);
Print("Hour =",hari.hour);

Paul

 

haidzatul Nazamri Rasda
139
haidzatul Nazamri Rasda 2010.04.19 06:30  
phampton:

Your MqlDateTime line only declares the structure and you need another command such as TimeCurrent to populate it.  This is documented in the MQL5 editor help.

Paul

 

it's work

Thank Paul 

 

/
To add comments, please log in or register