Candle Lowest & Highest Price

 

Hi,

I am trying to get the lowest and highest price of the candle but am getting it wrong it seems please assist if you can?

//Price is higher than lowest price D1:
if(iLowest(pairs[i], toTF(PCS_TimeFrame1), 0) < symbols[i].ask)

//Price is lower than highest price D1:
else if(iHighest(pairs[i], toTF(PCS_TimeFrame1), 0) > symbols[i].ask)

Am getting opposite data...

 
katiz22:

Hi,

I am trying to get the lowest and highest price of the candle but am getting it wrong it seems please assist if you can?

Am getting opposite data...

Hi katiz,

Read documents fully!!

search for iLowest here (mql5.com) and read related document fully to understand what supposed to be Received when you Call for that function?!

Files:
 
katiz22: I am trying to get the lowest and highest price of the candle but am getting it wrong it seems please assist if you can? Am getting opposite data...

Please read the documentation! iLowest and iHighest return a bar shift or index, not a price quote. Please study the examples in the documentation.

iHighest

Returns the shift of the maximum value over a specific number of bars

Timeseries and Indicators Access

iLowest

Returns the shift of the lowest value over a specific number of bars

Timeseries and Indicators Access

 
Mahdi Ebrahimzadeh #: Read documents fully!! search for iLowest here (mql5.com) and read related document fully to understand what supposed to be Received when you Call for that function?!
This is the MQL4 section, not the MQL5 section. You are giving instruction for the OP to look at the MQL5 documentation. The MQL4 documentation is located here ... https://docs.mql4.com/
MQL4 Reference
MQL4 Reference
  • docs.mql4.com
MQL4 Reference
 
Fernando Carreiro #:
This is the MQL4 section, not the MQL5 section. You are giving instruction for the OP to look at the MQL5 documentation. The MQL4 documentation is located here ... https://docs.mql4.com/

same function different addresses but thanks to notify.

 
Mahdi Ebrahimzadeh #: same function different addresses but thanks to notify.

There are many functions that have the same names but work differently between the two platforms. So it is best to direct users to the correct documentation to prevent confusion.

 
Mahdi Ebrahimzadeh #:

Hi katiz,

Read documents fully!!

search for iLowest here (mql5.com) and read related document fully to understand what supposed to be Received when you Call for that function?!

Hi thank for clarifying...

Fernando Carreiro #:
This is the MQL4 section, not the MQL5 section. You are giving instruction for the OP to look at the MQL5 documentation. The MQL4 documentation is located here ... https://docs.mql4.com/

Hi thank for clarifying...

Then from my search - iHigh and iLow will give me the price I want...?


 
katiz22 #: Then from my search - iHigh and iLow will give me the price I want...?

Show your new code for clarification.

 
Fernando Carreiro #:

Show your new code for clarification.

//Price above candles lowest price
if(iLow(pairs[i], toTF(PCS_TimeFrame1), 0) < symbols[i].ask...

//Price below candles highest price
else if(iHigh(pairs[i], toTF(PCS_TimeFrame1), 0) > symbols[i].ask...
 
katiz22 #: Then from my search - iHigh and iLow will give me the price I want...?

Look at the documentation again. What does iHigh/iLow return? Fernando even copy/pasted it for you.

Did you not bother to read it? If you are not going to read our replies, you're at wasting everyone's time.