Download MetaTrader 5

Check the change of Day

To add comments, please log in or register
BigAl
489
BigAl 2013.03.11 10:25 
has anyone found a easy way to check when the day changes. On MT4 I used the simple code attached. Is there an equally simple way to do it in MT5 please.
  if (DayOfYear() != OldDayOfYear)
   {
    OldDayOfYear = DayOfYear();
Simon Gniadkowski
Moderator
18002
Simon Gniadkowski 2013.03.11 11:17  
BigAl:
has anyone found a easy way to check when the day changes. On MT4 I used the simple code attached. Is there an equally simple way to do it in MT5 please.

You could do something like this . . .

MqlDateTime StrucNow;

TimeToStruct(TimeCurrent(), StrucNow);

if (StrucNow.day_of_year != OldDayOfYear)
   {
    
   OldDayOfYear = StrucNow.day_of_year;
   }

 MqlDateTime

BigAl
489
BigAl 2013.03.11 11:28  
RaptorUK:

You could do something like this . . .

 MqlDateTime

just the ticket. thanks
To add comments, please log in or register