OPEN-SOURCE SCRIPT
ZigZag Break - Phase 3 Toggle Sync V6 (Display Only)

### Overview
"ZigZag Break - Phase 3 Toggle Sync V6" is an analytical tool designed to visualize market structure transitions based on Dow Theory and multi-timeframe Moving Average (MA) dynamics.
It automatically detects key structural swing points (labeled 1 to 6), tracks horizontal breakout levels, and monitors multi-timeframe MA alignments to provide structured, multi-step signal conditions.
### Key Features
1. **Dow Theory & Vertex Tracking (1-2-3 Patterns):**
- Identifies trend reversal origin points (Vertex 1) upon confirmed price breaks.
- Plots sequential market structure vertices (1, 2, 3, 4, 5, 6) based on strict price action criteria.
- Automatically draws persistent horizontal levels for key even/odd structural highs and lows.
2. **Multi-Timeframe MA Alignment & Sorting:**
- Evaluates MA directions across higher timeframes.
- Displays a real-time sorted panel showing the hierarchical order of current price relative to MTF MAs.
3. **Sequential Step-Alert System:**
- Evaluates multi-stage technical events (e.g., Convergence -> Divergence -> Structural Peak/Valley or Dow Break).
- Fires unified alerts when a custom sequence of technical conditions is fully met.
### Technical & Repainting Notice
- **Use of `lookahead_on`:**
This indicator utilizes `lookahead=barmerge.lookahead_on` inside multi-timeframe `request.security` functions. This design explicitly references confirmed historical higher-timeframe bar closes (`close[1]`) to calculate higher-timeframe market structure levels without referencing unconfirmed real-time higher-timeframe data.
- **Historical Consistency:**
Historical line/label positions correspond strictly to completed higher-timeframe bar boundaries. Current real-time bars process ongoing price updates dynamically until bar close.
■ 概要
「ZigZag Break - Phase 3 Toggle Sync V6」は、ダウ理論に基づく波形・構造変化と、マルチタイムフレーム(MTF)における移動平均線(MA)の方向性を可視化・分析するためのテクニカル指標です。
過去の高値・安値に対する終値ブレイクを起点とした構造転換(頂点1〜6)の全自動検出、重要な水平線の自動描画、および複数段階のテクニカル条件を組み合わせたステップアラート機能を搭載しています。
■ 主な機能
1. ダウ理論 & 頂点追跡(1-2-3パターン):
- 終値での高値/安値ブレイクを検知し、構造の転換点(頂点1)およびその後の波形(1, 2, 3, 4, 5, 6)を自動ナンバリング。
- 直近の偶数頂点(2, 4, 6)や奇数頂点(3, 5)、ブレイク起点となる最重要水平線を追跡・描画。
2. マルチタイムフレーム(MTF)MA方向 & リアルタイムソート:
- 各時間足のMAの傾き・位置関係を判定。
- 現在価格と上位足MAの階層構造をリアルタイムで並び替えて一覧表示するソートテーブル機能。
3. 段階的ステップアラート(Step Alert System):
- 「MAの収束」→「MAの拡散」→「山谷形成 / ダウブレイク」といった複数のテクニカルイベントの順次達成をトリガーとするアラート機能。
■ テクニカル仕様および「lookahead_on」に関する注記
・`lookahead_on` の使用について:
本インジケーターでは、マルチタイムフレームのデータ取得処理(`request.security`)において `lookahead=barmerge.lookahead_on` を使用しています。これは、未確定の上位足リアルタイムデータによるシグナル変化を避け、確定済みの過去足終値(`close[1]`)に基づいた正確な構造計算・描画を行うための仕様設計です。
・ヒストリカルデータとリアルタイムデータの挙動:
過去チャート上のラインやラベルの表示位置は、確定した上位足のバー境界に基づいて正確に描画されます。進行中のリアルタイム足においては、足確定まで価格変化に応じて動的に計算が更新されます。
"ZigZag Break - Phase 3 Toggle Sync V6" is an analytical tool designed to visualize market structure transitions based on Dow Theory and multi-timeframe Moving Average (MA) dynamics.
It automatically detects key structural swing points (labeled 1 to 6), tracks horizontal breakout levels, and monitors multi-timeframe MA alignments to provide structured, multi-step signal conditions.
### Key Features
1. **Dow Theory & Vertex Tracking (1-2-3 Patterns):**
- Identifies trend reversal origin points (Vertex 1) upon confirmed price breaks.
- Plots sequential market structure vertices (1, 2, 3, 4, 5, 6) based on strict price action criteria.
- Automatically draws persistent horizontal levels for key even/odd structural highs and lows.
2. **Multi-Timeframe MA Alignment & Sorting:**
- Evaluates MA directions across higher timeframes.
- Displays a real-time sorted panel showing the hierarchical order of current price relative to MTF MAs.
3. **Sequential Step-Alert System:**
- Evaluates multi-stage technical events (e.g., Convergence -> Divergence -> Structural Peak/Valley or Dow Break).
- Fires unified alerts when a custom sequence of technical conditions is fully met.
### Technical & Repainting Notice
- **Use of `lookahead_on`:**
This indicator utilizes `lookahead=barmerge.lookahead_on` inside multi-timeframe `request.security` functions. This design explicitly references confirmed historical higher-timeframe bar closes (`close[1]`) to calculate higher-timeframe market structure levels without referencing unconfirmed real-time higher-timeframe data.
- **Historical Consistency:**
Historical line/label positions correspond strictly to completed higher-timeframe bar boundaries. Current real-time bars process ongoing price updates dynamically until bar close.
■ 概要
「ZigZag Break - Phase 3 Toggle Sync V6」は、ダウ理論に基づく波形・構造変化と、マルチタイムフレーム(MTF)における移動平均線(MA)の方向性を可視化・分析するためのテクニカル指標です。
過去の高値・安値に対する終値ブレイクを起点とした構造転換(頂点1〜6)の全自動検出、重要な水平線の自動描画、および複数段階のテクニカル条件を組み合わせたステップアラート機能を搭載しています。
■ 主な機能
1. ダウ理論 & 頂点追跡(1-2-3パターン):
- 終値での高値/安値ブレイクを検知し、構造の転換点(頂点1)およびその後の波形(1, 2, 3, 4, 5, 6)を自動ナンバリング。
- 直近の偶数頂点(2, 4, 6)や奇数頂点(3, 5)、ブレイク起点となる最重要水平線を追跡・描画。
2. マルチタイムフレーム(MTF)MA方向 & リアルタイムソート:
- 各時間足のMAの傾き・位置関係を判定。
- 現在価格と上位足MAの階層構造をリアルタイムで並び替えて一覧表示するソートテーブル機能。
3. 段階的ステップアラート(Step Alert System):
- 「MAの収束」→「MAの拡散」→「山谷形成 / ダウブレイク」といった複数のテクニカルイベントの順次達成をトリガーとするアラート機能。
■ テクニカル仕様および「lookahead_on」に関する注記
・`lookahead_on` の使用について:
本インジケーターでは、マルチタイムフレームのデータ取得処理(`request.security`)において `lookahead=barmerge.lookahead_on` を使用しています。これは、未確定の上位足リアルタイムデータによるシグナル変化を避け、確定済みの過去足終値(`close[1]`)に基づいた正確な構造計算・描画を行うための仕様設計です。
・ヒストリカルデータとリアルタイムデータの挙動:
過去チャート上のラインやラベルの表示位置は、確定した上位足のバー境界に基づいて正確に描画されます。進行中のリアルタイム足においては、足確定まで価格変化に応じて動的に計算が更新されます。
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.