OPEN-SOURCE SCRIPT

Sentinel Market Structure [JOAT]

7 114

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:
Pine Script®
bool swingHighDetected = high[swingLength] == ta.highest(high, swingLength * 2 + 1) bool swingLowDetected = low[swingLength] == ta.lowest(low, swingLength * 2 + 1)


BOS vs CHoCH Logic:
Pine Script®
// 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:
Pine Script®
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

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.