OPEN-SOURCE SCRIPT
Telah dikemas kini HH HL LH LL + BOS / CHoCH

HH HL LH LL + BOS / CHoCH Structure Indicator (ATR Adaptive)
This indicator provides a complete market structure framework using swing-based pivots, real-time trend detection, BOS (Break of Structure), CHoCH (Change of Character), and optional ATR-adaptive swing sensitivity.
🔹 Core Features
1. Market Structure Labels
The script detects and labels:
HH – Higher High
LH – Lower High
HL – Higher Low
LL – Lower Low
These labels help visualize trend continuation or weakness in structure.
Each label type can be individually toggled ON/OFF in settings.
2. ATR-Based Adaptive Swing Length (Optional)
Swing pivots can be calculated using:
A fixed manual swing length, or
A dynamic ATR-based swing length that adjusts automatically to volatility.
Increasing volatility → longer swings
Decreasing volatility → tighter swings
This makes structure detection more stable and timeframe-adaptive.
3. Close-Based Break of Structure (BOS)
The indicator identifies a BOS when:
Price closes above the previous swing high (Bullish BOS↑)
Price closes below the previous swing low (Bearish BOS↓)
BOS labels can be turned ON/OFF without affecting internal calculations.
4. CHoCH (Change of Character)
CHoCH is triggered when a BOS occurs against the current trend, indicating a potential trend reversal:
CHoCH↑ – Bearish → Bullish reversal
CHoCH↓ – Bullish → Bearish reversal
CHoCH remains active even when BOS labels are turned off.
5. Alerts
The indicator provides alert conditions for:
CHoCH↑ (Bullish Trend Shift)
CHoCH↓ (Bearish Trend Shift)
This allows traders to automate notifications for significant trend changes.
6. Trend State Tracking
The script internally tracks the current structure-based trend:
Uptrend
Downtrend
Undefined
The trend updates dynamically based on real BOS events.
7. Fully Backwards Compatible
The indicator generates structure, BOS, and CHoCH even when scrolling back deep in chart history, thanks to extended max_bars_back handling.
Summary
This tool provides a complete, flexible, and non-repainting framework for market structure analysis, suitable for:
SMC/ICT traders
Swing & intraday traders
Trend traders
Price action analysts
With adaptive swing detection, clean structure labeling, BOS/CHoCH logic, and alert integration, the indicator helps traders understand market transitions with clarity and precision.
This indicator provides a complete market structure framework using swing-based pivots, real-time trend detection, BOS (Break of Structure), CHoCH (Change of Character), and optional ATR-adaptive swing sensitivity.
🔹 Core Features
1. Market Structure Labels
The script detects and labels:
HH – Higher High
LH – Lower High
HL – Higher Low
LL – Lower Low
These labels help visualize trend continuation or weakness in structure.
Each label type can be individually toggled ON/OFF in settings.
2. ATR-Based Adaptive Swing Length (Optional)
Swing pivots can be calculated using:
A fixed manual swing length, or
A dynamic ATR-based swing length that adjusts automatically to volatility.
Increasing volatility → longer swings
Decreasing volatility → tighter swings
This makes structure detection more stable and timeframe-adaptive.
3. Close-Based Break of Structure (BOS)
The indicator identifies a BOS when:
Price closes above the previous swing high (Bullish BOS↑)
Price closes below the previous swing low (Bearish BOS↓)
BOS labels can be turned ON/OFF without affecting internal calculations.
4. CHoCH (Change of Character)
CHoCH is triggered when a BOS occurs against the current trend, indicating a potential trend reversal:
CHoCH↑ – Bearish → Bullish reversal
CHoCH↓ – Bullish → Bearish reversal
CHoCH remains active even when BOS labels are turned off.
5. Alerts
The indicator provides alert conditions for:
CHoCH↑ (Bullish Trend Shift)
CHoCH↓ (Bearish Trend Shift)
This allows traders to automate notifications for significant trend changes.
6. Trend State Tracking
The script internally tracks the current structure-based trend:
Uptrend
Downtrend
Undefined
The trend updates dynamically based on real BOS events.
7. Fully Backwards Compatible
The indicator generates structure, BOS, and CHoCH even when scrolling back deep in chart history, thanks to extended max_bars_back handling.
Summary
This tool provides a complete, flexible, and non-repainting framework for market structure analysis, suitable for:
SMC/ICT traders
Swing & intraday traders
Trend traders
Price action analysts
With adaptive swing detection, clean structure labeling, BOS/CHoCH logic, and alert integration, the indicator helps traders understand market transitions with clarity and precision.
Nota Keluaran
BOS now triggers only once per pivot, eliminating repeated continuation signalsBOS is confirmed only when price closes beyond the previous swing high/low
CHoCH remains independent of BOS visibility and triggers on the first BOS in the opposite trend direction
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.