OPEN-SOURCE SCRIPT
ZigZag

ZigZag Indicator – Overview
How It Works
Settings
What You See on the Chart
Why This ZigZag Is Useful
Recommended Use Cases
This ZigZag indicator highlights the most important swing highs and swing lows on the chart, helping traders see market structure more clearly by filtering out minor price movements. It connects significant turning points with straight lines, creating a clean visual representation of trend direction and major reversals.
How It Works
- Price constantly moves up and down, but not every movement is meaningful. The ZigZag indicator waits for price to make a move large enough to be considered a true swing point. Once such a movement occurs, the indicator identifies it as either a swing high or a swing low and draws a line connecting it to the previous swing.
- This produces a simplified outline of market structure, making it easier to recognize trends, corrections, and major turning points.
Settings
- ZigZag Length
Controls the sensitivity of the indicator.
Lower values produce more frequent swing points.
Higher values show only major swings and reduce noise. - Show ZigZag
Enables or disables the visual lines. When disabled, the indicator continues tracking swing points internally.
What You See on the Chart
- Every time the market creates a confirmed swing high or swing low, the indicator draws a line to the previous swing in the opposite direction.
- After a major low is confirmed, a line is drawn to the most recent high.
- After a major high is confirmed, a line is drawn to the most recent low.
- This creates a clear, continuous zigzag that outlines the dominant movements of the market without reacting to every small fluctuation.
Why This ZigZag Is Useful
- It does not repaint once a swing is confirmed.
- It provides a clean and simplified view of price structure.
- It helps identify trend direction, structure breaks, impulses, and corrections.
- It is useful for traders who follow price action, smart money concepts, and swing-based strategies.
Recommended Use Cases
- This ZigZag indicator is suited for traders who rely on market structure analysis, including:
- Swing trading
- Smart Money Concepts (BOS/CHOCH detection)
- Identifying impulses and pullbacks
- Finding strong highs and lows
- Studying overall trend direction
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。