Help Please on iHighest

Back to topics list  | 1 2 To post a new topic, please log in or register
avatar
872
eevviill 2016.03.07 01:02 #
 
dkpmba:

Damn man! so it works backward and I was thinking forward. So when we say

 for(int i=0; i<Bars; i++)

 

i = 0 is the most recent bar and i = 1 is the bar previous to the most recent one. And I was thinking that i = 0 is the first (historical) bar in the current chart. Thanks guys you rock! 

 

My pleasure.

(in mql5 indexation is like you thought and it is uncomfortable) 

avatar
12985
WHRoeder 2016.03.07 17:03 #
 
dkpmba: Damn man! so it works backward and I was thinking forward. So when we say

 for(int i=0; i<Bars; i++)

i = 0 is the most recent bar and i = 1 is the bar previous to the most recent one. And I was thinking that i = 0 is the first (historical) bar in the current chart.

In indicators (only) you can use the arguments in OnCalculate (high, low, etc. ) and set them to series (Bars-1, ..., 2,1, 0=current) or not series (0=oldest, 1,2,... Bars-1) Buffers default to series and you have to set them to not series, to match.

The Predefined Variables - MQL4 Reference High, Low, etc., are always series and thus work with iHighest - Timeseries and Indicators Access - MQL4 Reference, etc. 

Note the difference high vs High and low vs Low.



Back to topics list   | 1 2  

To add comments, please log in or register