How to execute trade at the :00 minute of every hour?

 
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)
 
in MT4:
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) ...
 
Look for newbar code. Use a bool to control it.
 
Dua Yong Rew: Look for newbar code. Use a bool to control it.
Valid only on H1 bars.. Never stated by OP.
Reason: