Download MetaTrader 5
To add comments, please log in or register
Manage agents in your profile. It is easy!
Frank Holland
11
Frank Holland 2014.06.12 10:59 

I'm using build 646 v4.00.

Alert("TimeHour(TimeCurrent()) = ", TimeHour(TimeCurrent()));  //works 

Alert("TimeMinute(Time[i]) = ", TimeMinute(Time[10]));  //works, alert displays minute value 10 mins ago

Alert("TimeHour(Time[i]) = ",     TimeHour(Time[4])); //Doesn't work, alert displays current hour value


Any ideas anybody?

whroeder1
13656
whroeder1 2014.06.12 14:11  
WoodenHorse:
Alert("TimeMinute(Time[i]) = ", TimeMinute(Time[10]));  //works, alert displays minute value 10 mins ago
Alert("TimeHour(Time[i]) = ",     TimeHour(Time[4])); //Doesn't work, alert displays current hour value
Time[10]  is not 10 minutes ago, it is 10 bars ago. On a D1 chart that is 10 trading days ago.
On H1 or higher charts, TimeMinute(Time[x]) will always be zero. On M5 chart it will always be a multiple of 5.
Only on the M1 chart will Time[10] be approximately 10 minutes ago.
Frank Holland
11
Frank Holland 2014.06.12 14:47  

Many thanks for your quick, detailed & easy to follow response.

Alas, I think I was having a bit of a senior moment!

Cheers.

/
To add comments, please log in or register