Lowest High coding

 

Hi All


Quite happy with eg Highest High (of past 10 bars including current) coding, as below:


  double val;
val=High[iHighest(NULL,0,MODE_HIGH,10,0)];


Quick question though..... If I wanted to find the Highest LOW or Lowest HIGH..... I would imagine i would simply change the MODE_HIGH / MODE_LOW to change the source. Is this correct?

Not sure if I would need to change the High / Low at the beginning aswell eg

  double val;
val=Low[iHighest(NULL,0,MODE_LOW,10,0)];

Any help would be appreciated.


Thanks in advance


Richard

 

Hi Richard

I always have to think about these convoluted statements too. You should separate them to understand what's what. High[] is just an array for which you require a position to get a price. It is the iHighest() function that does the work of finding the location of the high value. This function acesses the candles in the range you select and uses the price type given by MODE_. You could select MODE_CLOSE and find the highest close over the selected range if you want. The bottom line is the function returns the location of the value but to get the price you have to use the location on the array of prices so normally High[] would be used with MODE_HIGH, Low[] with MODE_LOW, Close[] with MODE_CLOSE and Open[] with MODE_OPEN. I now understand it better having explained it to you.

 
Ruptor:

Hi Richard

I always have to think about these convoluted statements too. You should separate them to understand what's what. High[] is just an array for which you require a position to get a price. It is the iHighest() function that does the work of finding the location of the high value. This function acesses the candles in the range you select and uses the price type given by MODE_. You could select MODE_CLOSE and find the highest close over the selected range if you want. The bottom line is the function returns the location of the value but to get the price you have to use the location on the array of prices so normally High[] would be used with MODE_HIGH, Low[] with MODE_LOW, Close[] with MODE_CLOSE and Open[] with MODE_OPEN. I now understand it better having explained it to you.

Ruptor

Thanks very much for your response.

Took a little while to work through how it all fits together, but i think i get it now.

Thank you for your time

Richard

Reason: