jon:
How to execute trade at the :00 minute of every hour?
i.e. 1:00pm, 2:00pm, 3:00pm
when conditions are met.
in MT4:
if(Minute()==0)
//---
in MT5
MqlDateTime mqltime;
TimeToStruct(TimeCurrent(),mqltime);
if(mqltime.min==0)
if(Minute()==0)
//---
in MT5
MqlDateTime mqltime;
TimeToStruct(TimeCurrent(),mqltime);
if(mqltime.min==0)
in MT4:
if(Minute()==0)
if(Minute()==0)
The problem is this fails if there is no tick in the first minute. See "Free-of-Holes" Charts - MQL4 Articles
static int minuteCur=60; int minutePre = minuteCur;
minuteCur = Minute(); bool isTopOfTheHour = minuteCur < minutePre;
if(isTopOfTheHour) ...
minuteCur = Minute(); bool isTopOfTheHour = minuteCur < minutePre;
if(isTopOfTheHour) ...
Dua Yong Rew: Look for newbar code. Use a bool to control it.
| Valid only on H1 bars.. Never stated by OP. |

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 execute trade at the :00 minute of every hour?
i.e. 1:00pm, 2:00pm, 3:00pm
when conditions are met.