PROTECTED SOURCE SCRIPT
Swing Zig Zag - Market Structure Indicator by Panda Trading

Overview
The Swing Zig Zag indicator is a powerful tool for identifying market structure changes, Break of Structure (BOS), and Change of Character (CHoCH) patterns. It automatically detects and visualizes key price action levels, helping traders identify potential trend reversals and continuation patterns.
Key Features
📊 Market Structure Detection
- Break of Structure (BOS): Identifies when price breaks significant swing highs/lows, indicating trend continuation
- Change of Character (CHoCH): Detects trend reversals when price breaks counter-trend levels
- Visual ZigZag Lines: Connects CHoCH points to clearly visualize market structure flow
🎨 Customizable Display
- **Adjustable Pivot Length**: Control sensitivity of swing point detection (default: 5)
- **Two Detection Modes**:
- Extreme Points: Uses absolute highs and lows
- Adjusted Points: Dynamically adjusts levels for better accuracy
- **Line Limit Control**: Display up to 500 structure lines to keep charts clean
- **Color-Coded Levels**: Distinct colors for bullish/bearish BOS and CHoCH
⚡ Real-Time Alerts
- Built-in alert system for CHoCH detection
- Separate alerts for bullish and bearish changes
- Once-per-bar alert frequency to avoid spam
🔧 Customization Options
- ZigZag Lines: Toggle visibility, customize color, width, and style (Solid/Dashed/Dotted)
- Structure Lines: Show/hide market structure with adjustable display limit
- CHoCH Extension: Horizontal lines extend forward to highlight active levels
How to Use
1. Trend Following: Use BOS confirmations to enter in the direction of the trend
2. Reversal Trading: Watch for CHoCH signals indicating potential trend changes
3. Support/Resistance: CHoCH levels often act as key support and resistance zones
4. Market Structure: The zigzag pattern helps identify higher highs/lows and market phases
Settings
- Pivot Length: Controls sensitivity (lower = more signals, higher = stronger signals)
- Structure Limit: Number of historical structure lines to display (10-500)
- ZigZag Display: Toggle and customize the connecting lines between CHoCH points
- Mode Selection: Choose between Extreme Points or Adjusted Points for different trading styles
Best Practices
- Combine with other indicators for confirmation
- Use on higher timeframes for stronger signals
- Wait for candle close before acting on signals
- CHoCH levels can act as dynamic support/resistance
Technical Notes
- Maximum 5000 bars lookback
- Supports up to 500 lines and labels
- Optimized for performance on all timeframes
- Works on all markets: Forex, Crypto, Stocks, Indices
---
Perfect for: Price action traders, swing traders, and anyone looking to understand market structure and trend changes with clarity.
The Swing Zig Zag indicator is a powerful tool for identifying market structure changes, Break of Structure (BOS), and Change of Character (CHoCH) patterns. It automatically detects and visualizes key price action levels, helping traders identify potential trend reversals and continuation patterns.
Key Features
📊 Market Structure Detection
- Break of Structure (BOS): Identifies when price breaks significant swing highs/lows, indicating trend continuation
- Change of Character (CHoCH): Detects trend reversals when price breaks counter-trend levels
- Visual ZigZag Lines: Connects CHoCH points to clearly visualize market structure flow
🎨 Customizable Display
- **Adjustable Pivot Length**: Control sensitivity of swing point detection (default: 5)
- **Two Detection Modes**:
- Extreme Points: Uses absolute highs and lows
- Adjusted Points: Dynamically adjusts levels for better accuracy
- **Line Limit Control**: Display up to 500 structure lines to keep charts clean
- **Color-Coded Levels**: Distinct colors for bullish/bearish BOS and CHoCH
⚡ Real-Time Alerts
- Built-in alert system for CHoCH detection
- Separate alerts for bullish and bearish changes
- Once-per-bar alert frequency to avoid spam
🔧 Customization Options
- ZigZag Lines: Toggle visibility, customize color, width, and style (Solid/Dashed/Dotted)
- Structure Lines: Show/hide market structure with adjustable display limit
- CHoCH Extension: Horizontal lines extend forward to highlight active levels
How to Use
1. Trend Following: Use BOS confirmations to enter in the direction of the trend
2. Reversal Trading: Watch for CHoCH signals indicating potential trend changes
3. Support/Resistance: CHoCH levels often act as key support and resistance zones
4. Market Structure: The zigzag pattern helps identify higher highs/lows and market phases
Settings
- Pivot Length: Controls sensitivity (lower = more signals, higher = stronger signals)
- Structure Limit: Number of historical structure lines to display (10-500)
- ZigZag Display: Toggle and customize the connecting lines between CHoCH points
- Mode Selection: Choose between Extreme Points or Adjusted Points for different trading styles
Best Practices
- Combine with other indicators for confirmation
- Use on higher timeframes for stronger signals
- Wait for candle close before acting on signals
- CHoCH levels can act as dynamic support/resistance
Technical Notes
- Maximum 5000 bars lookback
- Supports up to 500 lines and labels
- Optimized for performance on all timeframes
- Works on all markets: Forex, Crypto, Stocks, Indices
---
Perfect for: Price action traders, swing traders, and anyone looking to understand market structure and trend changes with clarity.
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由使用,沒有任何限制 — 點擊此處了解更多。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由使用,沒有任何限制 — 點擊此處了解更多。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。