PROTECTED SOURCE SCRIPT
Aggiornato

[TehThomas] - Market Structure Shift (MSS)

4 383

[TehThomas] - Market Structure Shift (MSS) Script Overview
This TradingView script is designed to help traders identify Market Structure Shifts (MSS) and Breaks of Structure (BOS), which are key concepts in ICT (Inner Circle Trader) and Smart Money Concepts (SMC) trading. By detecting significant shifts in price action, the script provides visual cues and alerts to help traders spot potential trend changes and continuation patterns.

How the Script Works

1. Identifying Swing Highs & Lows
  • The script detects swing highs and swing lows based on a pivot strength setting (default: 3).
  • A swing high forms when a candle’s high is higher than the highs of a set number of candles on both sides.
  • A swing low forms when a candle’s low is lower than the lows of the surrounding candles.


2. Market Structure Shift (MSS) Detection
  • A bullish MSS occurs when price closes above the most recent swing high after previously being in a bearish trend.
  • A bearish MSS occurs when price closes below the most recent swing low after being in a bullish trend.
  • This signals a potential trend reversal and is often a key area for liquidity grabs and smart money entry points.


3. Break of Structure (BOS) Detection (Optional - Can be enabled/disabled in settings)
  • A BOS is detected when price continues in the direction of the trend, confirming a structural break rather than a shift.
  • Bullish BOS: Price breaks a swing high but does not reverse (confirms trend continuation).
  • Bearish BOS: Price breaks a swing low but continues downward.
  • BOS levels help traders confirm trend strength and potential trade continuation setups.


4. Drawing Structure Lines & Labels
  • The script plots horizontal lines at the detected MSS and BOS levels.
  • Labels such as "MSS" or "BOS" appear at the breakout points.
  • Traders can customize the line style, color, and text size for better visibility.


5. Alert System for MSS & BOS
  • The script includes alert conditions that notify traders when an MSS or BOS occurs.
  • Alerts can be set for:
  • Any MSS / Any BOS
  • Bullish MSS / Bullish BOS
  • Bearish MSS / Bearish BOS



Settings You Can Change
The script allows for full customization through the following input parameters:

Pivot Strength (pivot_strength)
  • Default: 4
  • Adjusts how many candles must be considered to form a valid swing high or low.
  • Higher values result in stronger structure points, while lower values detect short-term movements.


Color Settings
  • Highs Color (highs) → Default: Blue (for bullish structure)
  • Lows Color (lows) → Default: Red (for bearish structure)


Toggle Display Options
  • Show BOS (show_bos) → Enables/disables BOS detection.
  • Show MSS (show_mss) → Enables/disables MSS detection.


Line & Label Customization
  • BOS Line Style (bos_style) → Options: Solid, Dashed, Dotted
  • MSS Line Style (mss_style) → Options: Solid, Dashed, Dotted
  • BOS & MSS Line Width → Adjustable from 1 to 4 pixels
  • BOS & MSS Text Size → Options: Tiny, Small, Normal, Large, Huge
  • BOS & MSS Text Position → Options: Left, Center, Right


Why This Script is Useful
✔ Detects Key Market Structure Changes
  • MSS and BOS are critical for identifying trend reversals and trend continuations.
  • Helps traders avoid false breakouts by distinguishing between structural shifts and simple breakouts.


✔ Enhances Smart Money Trading Strategies
  • MSS often aligns with liquidity grabs before price reverses.
  • BOS confirms continuation trades in strong trends.
  • Works well with Fair Value Gaps (FVGs), Order Blocks (OBs), and Liquidity Zones.


✔ Customizable Alerts & Visuals
  • Traders can enable alerts for MSS and BOS to receive notifications when price shifts.
  • Adjustable styling ensures clarity across different trading setups.


✔ Works on Any Asset & Timeframe
  • Suitable for Forex, Crypto, Stocks, and Indices.
  • Can be used on lower timeframes (scalping) or higher timeframes (swing trading).


How to Use the Market Structure Shift Concept in Trading
1️⃣ Identify Market Conditions
  • Apply the script and check if price is forming Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), or Lower Lows (LL).
  • Determine if the market is trending or ranging.

2️⃣ Watch for MSS (Reversal Signals)
  • Bullish MSS: Price closes above a key swing high → potential bullish reversal.
  • Bearish MSS: Price closes below a swing low → potential bearish reversal.

3️⃣ Confirm BOS (Trend Continuation Signals)
  • Bullish BOS: Price continues breaking highs, confirming an uptrend.
  • Bearish BOS: Price continues breaking lows, confirming a downtrend.

4️⃣ Combine with Other ICT & SMC Concepts
  • Look for Order Blocks (OBs) and Fair Value Gaps (FVGs) near MSS/BOS levels for better trade entries.
  • Wait for liquidity grabs before entering trades (avoid stop hunts).
  • Use higher timeframe MSS/BOS zones as key support & resistance areas.


Final Thoughts
This script is a must-have tool for traders using ICT & SMC trading strategies. It helps identify trend shifts, liquidity grabs, and continuation moves by marking Market Structure Shifts (MSS) and Breaks of Structure (BOS) on the chart.
Note di rilascio
Changed the settings to automatically enable "Show MSS"
Note di rilascio
Fixed an issue where changing colors wouldn’t update the display correctly, causing the colors to stay the same.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.