M
Something like this to get you started - OTTOMH!
extern int StartHour=5; extern int EndHour=5; start() { if(TimeHour(TimeCurrent()) < StartHour) return(0); // stop execution if(TimeHour(TimeCurrent()) > EndHour) return(0); // stop execution // else carry on here with your process ... ... }
FWIW
-BB-
motocross49:
I have an EA and I want to open trades from 05:30 to 12:45
How can we code this?
Ionathan
Thanks for your help.
Can you add and the minutes?
M
This https://docs.mql4.com/dateandtime/Hour
and https://docs.mql4.com/dateandtime/Minute
are probably a better way to go
-BB-
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 have an EA and I want to open trades from 05:30 to 12:45
How can we code this?
Ionathan