How to use MqlDateTime? (day_of_week,hour)
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
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
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?