I think I understand what's wrong. The StrToTime doesn't work exactly like the Metaquotes description :
datetime var1; var1=StrToTime("2003.8.12 17:35"); var1=StrToTime("17:35"); // returns the current date with the given time var1=StrToTime("2003.8.12"); // returns the date with the midnight time of "00:00"
This was Stringo's reply on another thread (https://forum.mql4.com/5134):
stringo wrote >> Milan, is your local time GMT+2? I don't know what means CET timezone exactly. And what is your daylight savings correction? StrToTime uses gmtime if date missing. Obtained datetime value corrected with timezone value.
So Why there's no addition to the StrToTime's description for almost 2 years? Just a suggestion.
Thanks
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
Hello,
I'm trying to build an EA based on a specific trading time.
But it's not working.
And this simple code :
returning 23 when I put it in :
while the code below returning 22
Does the StrToTime function should returning the current day date value (22) if inserted to a TimeDay() function? I've change the "start" variable from "int" to datetime" and it's still returning the same value.
I'm using ODL's MT4 v 218, am I doing something wrong?
Thank you