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 อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน