In MT4 custom indicator/EA, how do I work with time please?
E.g every day 08:05, I would like to check the High/Low of this 5min bar. I don't know how to work with this 5 minute period only.
Many thanks Vic
//inputs:
input int InpMinuteYouNeed = 5;
input int InpHourYouNeed = 8;
void OnTick(){
if(Hour()==InpHourYouNeed && Minute()==InpMinuteYouNeed){
}
}
Also you may found the following functions interesting:
datetime time = StrToTime("8:05");
int hourYouNeed = TimeHour(time);
int minuteYouNeed = TimeMinute(time);
then use these values same as InpHourYouNeed but of course they must be global or in struct. This must be enough for the first time.