ZigZag - maximum number of bars it can repaint?

 

Does anyone know if there is a maximum number of bars beyond which the default MT4 ZigZag indicator will not re-paint?

After spending a full day trying to understand the code for calculating ZigZag, and reading all the posts I can find, I think I am right in saying that the default MT4 indicator can re-paint based upon the PERCENTAGE change in recent price movements ....

... but does anyone know if this ever translates into a known maximum number of BARS beyond which it will never re-paint?

I'm guessing it might be related to the "ExtBackstep" external variable, which is set to 3 by default, suggesting that the maximum is 3 bars - but I can't understand the code well enough to say for certain!

(I'm not looking for a version of ZigZag which doesn't repaint - I already have one. I'm just trying to understand whether there is a "safe point" with the default indicator.)

Thanks.

 

You can't say depends on how many bars it keeps trending up or down

In this picture zigzag

5 brown

13 mediumVioletRed

34 yellow the arrows are repainted values colors are showing also the period of the repainted zigzag

The other indicator shows highest/lowest value for period 13 and 34

The moment the high is not repainted again is the moment it touch the periods low.....

 

It repaints everytime a last high or low is breached. Check this out, at least repaints are limited to fractals.

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

 

That is what I suspected - thank you both for confirming it.

I think I shall try to re-write the default indicator to limit the number of bars back beyond which it can repaint, if I can decipher the sprawling code.

When I fail at that, I will go on to using the fractals filter, thanks!

Reason: