iTime indicator on Renko charts

 

Hi all, if I try to use the following code on a H1 chart 

 Print(iTime(NULL,NULL,1)-iTime(NULL,NULL,2) ); 

the result is 3600, 60 seconds x 60 minutes.

If I apply the code on a Renko chart I seem the result is not correct.

For instance the opening time for bar 1 and bar 2 is 11:44 and 11:35, the result is 541.

I would expect 1140 as result instead.

Could you help me to understand? 

Thank you 

 
Alberto Tortella:

Hi all, if I try to use the following code on a H1 chart 

the result is 3600, 60 seconds x 60 minutes.

If I apply the code on a Renko chart I seem the result is not correct.

For instance the opening time for bar 1 and bar 2 is 11:44 and 11:35, the result is 541.

I would expect 1140 as result instead.

Could you help me to understand? 

Thank you 

iTime() and many of the other time-series functions only work on the standard time-frame charts. They will not work on the Offline Charts.

So use the Time[] array series instead.

Time - Predefined Variables - MQL4 Reference
Time - Predefined Variables - MQL4 Reference
  • docs.mql4.com
Series array that contains open time of each bar of the current chart. Data like datetime represent time, in seconds, that has passed since 00:00 a.m. of 1 January, 1970. Series array elements are indexed in the...
 
Fernando Carreiro:

iTime() and many of the other time-series functions only work on the standard time-frame charts. They will not work on the Offline Charts.

So use the Time[] array series instead.


Solved.

Thank you very much! 

 
Alberto Tortella:

Hi all, if I try to use the following code on a H1 chart 

the result is 3600, 60 seconds x 60 minutes.

If I apply the code on a Renko chart I seem the result is not correct.

For instance the opening time for bar 1 and bar 2 is 11:44 and 11:35, the result is 541.

I would expect 1140 as result instead.

Could you help me to understand? 

Thank you 

Why is it incorrect? You have 9 minutes between 11:35 and 11:44, which is perfectly fit with 541 seconds.

Time on renko charts is also real time (at least the distance between opening times of bars, which are used on offline renko charts I saw).