PROTECTED SOURCE SCRIPT

ZigZag Strict + Filtered Divergence

36
This is not a traditional ZigZag. This script implements an advanced State Machine designed to filter market noise and identify only the most significant price swings (Major Turning Points) .

The core strength lies in its Strict AND Confirmation logic: a new swing is confirmed only when two conditions are met simultaneously: sufficient Price Deviation (e.g., 0.4%) AND sufficient Time/Bar Count (e.g., 5 bars) . This ensures the indicator is Non-Repainting and highly reliable.

Divergences (Regular and Hidden) are calculated exclusively between these Confirmed and Frozen extreme points, providing high-probability reversal and continuation signals, free from the noise of minor price fluctuations. Use this tool to visualize true market structure and execute precision trades based on validated momentum shifts.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.