THIS CODE IS BASED FROM THE MT4 ZIGZAG INDICATOR
THE ZIGZAG SETTINGS FOR THE MAIN ONE ON TRADINGVIEW DO NOT WORK THE SAME AS MT4
I HOPE U LOVE IT
I have had tons of experience on the ZIGZAG indicator and thought this might help someone.
Enjoy this code. Zigzag is a good indicator in many ways and people underestimate it because of its repainting