Download MetaTrader 5

Highest & lowest price

To add comments, please log in or register
FaatP94
64
FaatP94  
Hello, how can I get the highest and lowest price for the last 50 bars ? I'm new at mql and have no idea. 
honest_knave
Moderator
2403
honest_knave  

iHighest will tell you which bar made the highest price over the period specified (you want the last 50 bars). The bar number is called a shift.

iLowest will tell you which bar made the lowest price. 

You can then retrieve the actual price using High (or Low).

So if iHighest told you the highest price was on bar 39, you would retrieve that price with High[39].

Links should explain along with examples.

FaatP94
64
FaatP94  
Thank you very much I will try it now 
To add comments, please log in or register