Download MetaTrader 5

Problem using MqlDateTime

To add comments, please log in or register
Oraib
427
Oraib  

Hello 

After the last update MqlDateTime is not working and returning 0 all the time .

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
Rashid Umarov
Admin
12611
Rashid Umarov  
Please, provide the source which demonstrates this issue.

Oraib
427
Oraib  
Rosh:
Please, provide the source which demonstrates this issue.

Hello Rosh


//+------------------------------------------------------------------+
void OnTick()
  { MqlDateTime dt;
    Alert(dt.hour);
  }

//+------------------------------------------------------------------+


the result is always zero


Rashid Umarov
Admin
12611
Rashid Umarov  

You didn't initialze the dt value, try this:

void OnTick()
  { MqlDateTime dt;
    TimeCurrent(dt);
    Alert(dt.hour);
  }



Oraib
427
Oraib  
Rosh:

You didn't initialze the dt value, try this:



Thank you so much , it is working now ......All the best wishes
To add comments, please log in or register