
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
What does that have to do with my post?
Don't use StringToTime().
That would be a rather silly way to make it work.
ok , what is the solution after remove StringToTime()?
ok , what is the solution after remove StringToTime()?
You could use something like this
Note that this will only work if the start and end time is in the same day. So it will need to be refined if the trade time window passes through midnight.You could use something like this
Note that this will only work if the start and end time is in the same day. So it will need to be refined if the trade time window passes through midnight.so the EA open trades if time is 01:00 even broker time is different of local time ?
so the EA open trades if time is 01:00 even broker time is different of local time ?
The code does not use local time, only platform time.
Find bar of the same time one day ago - MQL4 programming forum 2017.10.06
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26.4 2019.05.20
The code does not use local time, only platform time.
alright
William Roeder:
Stop using strings and just specify the time
Find bar of the same time one day ago - MQL4 programming forum 2017.10.06
Why stop using strings?
How else to input the time of day to use?
William Roeder:
Same as my time() function, except you have to handle 4066 errors.
Why would I replace my simple line of code with yours?
I considered 4066 errors and in this case there is nothing to handle as it is not necessary.
The iTime() call will return the correct time if it is updated.
If it is not updated it will return 0 or the time from some days previous. In either case daysSeconds wll be calculated to much larger than TradeTimeEndSeconds so the if() will not be executed.
If I had been concerned about 4066 errors, I would have used midnight instead.