Question abouts fractals

 
How can I get the most recent high and low prices using fractals (or another better method)? Thank you.
 
johnw213:
How can I get the most recent high and low prices using fractals (or another better method)? Thank you.

More specifically, how can I retrieve the recent high and low values, and then insert into a double? Thanks.

 
Hi,
Simply use iFractal(), see https://docs.mql4.com/indicators/iFractals
exemple: double LastLowFractal = iFractals(Currency, TimeFrame, MODE_LOWER, shift);
Then program a loop from shift = 0 to 1000 and stop when you get a fractal != 0, in the previous exemple you will have your last lower fractal.
 
Thank you very much.
Reason: