MD KH:
hi. how can i get day of month in mql5 in integer?
I easily used :
for comparing, but in ME5 I can't find anything like this. Can someone explain it to me or show me how to write it, cause I'm not a pro coder? thanks.
hi
use this :
int dayOfMonth(datetime time){ MqlDateTime mqt; if(TimeToStruct(time,mqt)){ return(mqt.day); } return(-1); }
MD KH:
Read up TimeToStruct()hi. how can i get day of month in mql5 in integer?
I easily used :
for comparing, but in ME5 I can't find anything like this. Can someone explain it to me or show me how to write it, cause I'm not a pro coder? thanks.
First store the current time using iTime() into a variable of type datetime.
Then create an object of type MqlDateTime. It's a struct that you will use as a parameter for the function TimeToStruct()
Call TimeToStruct and Pass it the current time and your datetime structure.
From there you can call structure.day_of_week
MD KH:
PS, I don't think day of month is available from the TimeToStruct function. hi. how can i get day of month in mql5 in integer?
I easily used :
for comparing, but in ME5 I can't find anything like this. Can someone explain it to me or show me how to write it, cause I'm not a pro coder? thanks.
You'll have access to day, day of week, and day of year. Read the documentation to be absolutely sure, I may be wrong.
But I doubt it's available, you may need some elbow grease if you are determined to know which day of the month specifically
Gamuchirai Zororo Ndawana #:
PS, I don't think day of month is available from the TimeToStruct function.
Tell me what is your expectations for the "day of month" and how it is different from day.
PS, I don't think day of month is available from the TimeToStruct function.
You'll have access to day, day of week, and day of year. Read the documentation to be absolutely sure, I may be wrong.
But I doubt it's available, you may need some elbow grease if you are determined to know which day of the month specifically

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
hi. how can i get day of month in mql5 in integer?
I easily used :
for comparing, but in ME5 I can't find anything like this. Can someone explain it to me or show me how to write it, cause I'm not a pro coder? thanks.