# Finding past Highs & Lows

81

Dear Forum, noob question for you!

I am looking to use the iLowest & iHighest functions, to find the prices of past candles. I don't understand the output however - is it in pips or is it a price?

For example I used iLowest to find the lowest value of a candle 5 ticks prior. I used the following setup:

`double x=iLowest(NULL,0,MODE_LOW,5,0);`

I ran it in on open of a bar that had an (open) value of 1.08207. The bar 5 ticks back had a low of 1.08081. Should the result of the function be the low price 1.08081, or should it be the difference in pips 126?

In fact the formula returns a value 1.0, which I can't seem to make any sense out of.

Or, am I outright using the function incorrectly?

21914

Zippu iLowest & iHighest functions, to find the prices of past candles. I don't understand the output however - is it in pips or is it a price?
Neither! Perhaps you should read the manual. Very first sentence:
Returns the shift of the maximum value over a specific number of bars depending on type.
iHighest - Timeseries and Indicators Access - MQL4 Reference
81

William Roeder:
Neither! Perhaps you should read the manual. Very first sentence:

Hi William, thanks for your help.

I had in fact read that, but I'd understood shift to mean delta (jn price or pips). That's clearly not the case so thanks for pointing that out.

Is there actually a language function that does what I'm looking for, or should I write it myself? I've not managed to find anything that does this, yet.

As I'd mentioned I'm new, and I'm doing my best to learn on my own, however sometimes I need clarification regarding what I read from those who know better.

21914

Zippu iLowest & iHighest functions, to find the prices of past candles.

For example I used iLowest to find the lowest value of a candle 5 ticks prior. I used the following setup:
`double x=iLowest(NULL,0,MODE_LOW,5,0);`

Zippu: Is there actually a language function that does what I'm looking for, or should I write it myself?
Read and understand the documentation: iLowest returns the shift. Read and understand the documentation. iLow or Low[] returns the low of the specified candle.
```int iLowest=iLowest(NULL,0,MODE_LOW,5,0);
double x=Low[iLowest];         // Low - Predefined Variables - MQL4 Reference
//or
double x=iLow(NULL,0,iLowest); // https://docs.mql4.com/series/ilow
```
81

William Roeder:
Read and understand the documentation: iLowest returns the shift. Read and understand the documentation. iLow or Low[] returns the low of the specified candle.

/light switches on

That's great thank you very much William.

This also helps me to understand a few adjoining concepts about the language and its syntax... which will help me to better understand the definitions in the documentation in future ;)

Cheers!