OPEN-SOURCE SCRIPT
BOS & ChoCh Market Structure

BOS/ChoCh Market Structure Indicator
This indicator identifies key market structure shifts using Break of Structure (BOS) and Change of Character (ChoCh) signals based on pivot point analysis.
Concept
Break of Structure (BOS) occurs when price breaks through a significant pivot level in the direction of the current trend, signaling trend continuation. A bullish BOS happens when price breaks above a pivot high while in an uptrend, while a bearish BOS occurs when price breaks below a pivot low during a downtrend.
Change of Character (ChoCh) signals a potential trend reversal. It occurs when price breaks against the prevailing trend - breaking above a pivot high while in a downtrend, or breaking below a pivot low while in an uptrend. This indicates the market structure is shifting.
How It Works
The indicator automatically detects swing highs and lows using configurable pivot strength. When price breaks these levels, it plots:
Settings
Pivot Strength - Number of candles on each side required to confirm a swing high/low (default: 5). Higher values identify more significant pivots but produce fewer signals.
Breakout Confirmation - Choose whether breakouts require a candle close beyond the level ("Close") or just a wick touch ("Wick").
Show BOS / Show ChoCh - Toggle visibility of Break of Structure and Change of Character signals independently.
Colors - Customize the colors for bullish (cyan) and bearish (red) signals.
Perfect for swing traders and market structure analysis.
This indicator identifies key market structure shifts using Break of Structure (BOS) and Change of Character (ChoCh) signals based on pivot point analysis.
Concept
Break of Structure (BOS) occurs when price breaks through a significant pivot level in the direction of the current trend, signaling trend continuation. A bullish BOS happens when price breaks above a pivot high while in an uptrend, while a bearish BOS occurs when price breaks below a pivot low during a downtrend.
Change of Character (ChoCh) signals a potential trend reversal. It occurs when price breaks against the prevailing trend - breaking above a pivot high while in a downtrend, or breaking below a pivot low while in an uptrend. This indicates the market structure is shifting.
How It Works
The indicator automatically detects swing highs and lows using configurable pivot strength. When price breaks these levels, it plots:
- Color-coded labels (cyan for bullish breaks, red for bearish breaks)
- Small horizontal lines marking the exact breakout level
- Extended lines from pivot points showing key support/resistance levels
Settings
Pivot Strength - Number of candles on each side required to confirm a swing high/low (default: 5). Higher values identify more significant pivots but produce fewer signals.
Breakout Confirmation - Choose whether breakouts require a candle close beyond the level ("Close") or just a wick touch ("Wick").
Show BOS / Show ChoCh - Toggle visibility of Break of Structure and Change of Character signals independently.
Colors - Customize the colors for bullish (cyan) and bearish (red) signals.
Perfect for swing traders and market structure analysis.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.