OPEN-SOURCE SCRIPT
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.