Catching Zigzag tops and bottoms

 

Hi,

I need to catch the zigzag bottoms and tops but I have no idea what is the best method to to it. Should I use the while cycle and loop untill the corner condition is met?

How do you do it?

Thank you

 
mkheidzedavid:

Hi,

I need to catch the zigzag bottoms and tops but I have no idea what is the best method to to it. Should I use the while cycle and loop untill the corner condition is met?

How do you do it?

Thank you


https://www.mql5.com/en/code/10920

iCustom check

if highbuffer == zigzagbuffer

or lowbuffer == zigzagbuffer

Reason: