OPEN-SOURCE SCRIPT
Sentinel Market Structure [JOAT]

Sentinel Market Structure [JOAT] - Smart Money Structure Analysis
Introduction and Purpose
Sentinel Market Structure is an open-source overlay indicator that identifies swing highs/lows, tracks market structure (HH/HL/LH/LL), detects Break of Structure (BOS) and Change of Character (CHoCH) signals, and marks order blocks. The core problem this indicator solves is that retail traders often miss structural shifts that smart money traders use to identify trend changes.
This indicator addresses that by automatically tracking market structure and alerting traders to key structural breaks that often precede significant moves.
Why These Components Work Together
Each component provides different structural information:
1. Swing Detection - Identifies significant pivot highs and lows. These are the building blocks of market structure.
2. Structure Labels (HH/HL/LH/LL) - Classifies each swing relative to the previous swing. Higher Highs + Higher Lows = uptrend. Lower Highs + Lower Lows = downtrend.
3. Break of Structure (BOS) - Identifies when price breaks a swing level in the direction of the trend. This is a continuation signal.
4. Change of Character (CHoCH) - Identifies when price breaks a swing level against the trend. This is a potential reversal signal.
5. Order Blocks - Marks the last opposing candle before an impulse move. These zones often act as future support/resistance.
How the Detection Works
Swing Detection:
bool swingHighDetected = high[swingLength] == ta.highest(high, swingLength * 2 + 1)
bool swingLowDetected = low[swingLength] == ta.lowest(low, swingLength * 2 + 1)
BOS vs CHoCH Logic:
// BOS: Break in direction of trend (continuation)
bool bullishBOS = close > lastSwingHigh and marketTrend >= 0
// CHoCH: Break against trend (reversal signal)
bool bullishCHOCH = close > lastSwingHigh and marketTrend < 0
Order Block Detection:
bool bullOB = close[1] < open[1] and // Previous candle bearish
close > open and // Current candle bullish
close > high[1] and // Breaking above
(high - low) > ta.atr(14) * 1.5 // Strong impulse
Signal Types
- HH (Higher High) - Swing high above previous swing high (bullish structure)
- HL (Higher Low) - Swing low above previous swing low (bullish structure)
- LH (Lower High) - Swing high below previous swing high (bearish structure)
- LL (Lower Low) - Swing low below previous swing low (bearish structure)
- BOS↑/BOS↓ - Break of structure in trend direction (continuation)
- CHoCH↑/CHoCH↓ - Change of character against trend (potential reversal)
Dashboard Information
- Trend - Current market bias (BULLISH/BEARISH/NEUTRAL)
- Swing High - Last swing high price with HH/LH label
- Swing Low - Last swing low price with HL/LL label
- Structure - Current structure state (HH+HL, LH+LL, etc.)
- Price - Price position relative to structure
How to Use This Indicator
For Trend Following:
1. Identify trend using structure (HH+HL = uptrend, LH+LL = downtrend)
2. Enter on BOS signals in trend direction
3. Use swing levels for stop placement
For Reversal Trading:
1. Watch for CHoCH signals (break against trend)
2. Confirm with order block formation
3. Enter on retest of order block zone
For Risk Management:
1. Place stops beyond swing highs/lows
2. Use structure lines as trailing stop references
3. Exit when CHoCH signals against your position
Input Parameters
- Swing Detection Length (5) - Bars on each side for pivot detection
- Show Swing High/Low Points (true) - Toggle swing markers
- Show BOS/CHoCH (true) - Toggle structural break signals
- Show Structure Lines (true) - Toggle horizontal swing lines
- Show Order Blocks (true) - Toggle order block zones
- Zone Extension (50) - How far order block boxes extend
Timeframe Recommendations
- 15m-1H: Good for intraday structure analysis
- 4H-Daily: Best for swing trading structure
- Lower timeframes require smaller swing detection length
Limitations
- Swing detection has inherent lag (needs confirmation bars)
- Not all BOS/CHoCH signals lead to continuation/reversal
- Order block zones are simplified (not full ICT methodology)
- Structure analysis is subjective - different traders see different swings
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes.
This indicator does not constitute financial advice. Market structure analysis does not guarantee trade outcomes. Always use proper risk management.
- Made with passion by officialjackofalltrades
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
#1 Full Stack AI Trading Community
Website: jackofalltrades.vip
Discord: discord.com/invite/joat
Telegram: t.me/jackofalltradesvip
Instagram: instagram.com/jackofalltrades.vip/
2026: The Era of AI Trading 📈
Website: jackofalltrades.vip
Discord: discord.com/invite/joat
Telegram: t.me/jackofalltradesvip
Instagram: instagram.com/jackofalltrades.vip/
2026: The Era of AI Trading 📈
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
#1 Full Stack AI Trading Community
Website: jackofalltrades.vip
Discord: discord.com/invite/joat
Telegram: t.me/jackofalltradesvip
Instagram: instagram.com/jackofalltrades.vip/
2026: The Era of AI Trading 📈
Website: jackofalltrades.vip
Discord: discord.com/invite/joat
Telegram: t.me/jackofalltradesvip
Instagram: instagram.com/jackofalltrades.vip/
2026: The Era of AI Trading 📈
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.