Marking specific points

 

Hello,

I'm using the information in this post https://www.mql5.com/en/forum/159093#comment_3813702 to write an indicator that starts at Bars and goes down to 0 and detects and marks the previous turning point using logic similar to 

h0<h1&&h1>h2


or 

l0>l1&&l1<l2

but it's not marking the correct points. I suspect it because I'm replaying some of the bars at certain points as new events are being thrown and creating errors. Has anyone any examples of how to mark specific points while looping down to 0 so that I can learn how to do it correctly please?

Thanks.

Range not behaving as expected
Range not behaving as expected
  • 2016.05.11
  • www.mql5.com
Goodmorning all...
 
Use a buffer with arrows
Reason: