try these
int TimeSecond(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.sec);} int TimeMinute(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.min);} int TimeHour(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.hour);} int TimeDayOfWeek(datetime time){MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.day_of_week);} int TimeDay(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.day);} int TimeMonth(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.mon);} int TimeYear(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.year);}
Lorentzos Roussos #:
int TimeDay(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.day);} int TimeMonth(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.mon);} int TimeYear(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.year);}
int TimeDay(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.day);} int TimeMonth(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.mon);} int TimeYear(datetime time) {MqlDateTime mt;bool turn=TimeToStruct(time,mt);return(mt.year);}
Just out of curiosity, are these functions not defined in the DateTime.mqh? What could be the reason that I get the undeclared indentifier?
you just assumed I didn't look in there, of course I searched in there found another called DayName() that still didn't work, like I said I am new to this, posting here was my last resort

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I even had to explicitly include the DateTime header file which exists in my include/Tools directory just to be sure, the file was included successfully but everytime I test the EA, it pops up: 'TimeDayOfWeek' - undeclared identifier TrinityFX EA.mq5 44 8.