MqlDateTime mdt; TimeCurrent(mdt); if(Spread<MaxSpread && mdt.hour>=StartHour && mdt.hour<StopHour){
lippmaje:
It's working, thank you mate.
David Diez: How to write this on MQ5?
if(Spread<MaxSpread&&Hour()>=StartHour&&Hour()<StopHour){
int Hour(void ){ return TimeHour(TimeCurrent()); } int TimeHour(datetime when){ return when/3600 % 24; }See also Migrating from MQL4 to MQL5 - MQL5 Articles № 11 17 May 2010
Thank you for the Article link. It has been so useful to me.
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
How to write this on MQ5?
if(Spread<MaxSpread&&Hour()>=StartHour&&Hour()<StopHour){
Thank you in advance.