PROTECTED SOURCE SCRIPT
XAUUSD — OB + Internal/External MS (Pivot→Break, Exclusive Tags)

📌 XAUUSD — OB + Internal/External Market Structure (Pivot → Break, Exclusive Tags)
This indicator is designed for Smart Money Concepts (SMC) traders who want a clean, automated view of both Order Blocks (OBs) and Market Structure (MS) breaks on any chart.
It combines internal vs. external structure detection with displacement-based order block logic, ensuring precise levels with minimal noise.
🔹 Features
Internal & External Market Structure
Detects swing highs/lows with customizable pivot settings.
Identifies BOS (Break of Structure) vs CHoCH (Change of Character).
Clear visual tags with color-coded breaks.
Option to display Internal only, External only, or Both.
Exclusive Tag Logic
Avoids duplicate text when both Internal & External break on the same bar.
Choose your preference: Internal priority or External priority.
Optional de-duplication filter (ATR-based + bar lookback).
Order Blocks (OBs)
Automatic detection based on displacement × ATR.
Bullish and bearish OB zones with configurable styling.
Median line (optional) for refined entry targeting.
Automatic deletion after mitigation or X touches (user-defined).
Maximum zones displayed (for chart clarity).
Smart Filtering
Break confirmation can be based on candle close or wick touch.
Minimum displacement filter relative to ATR.
Gap filter to avoid false breaks.
🔹 Inputs
Market Structure
Internal vs External swing lengths.
Break confirmation method (Close / Wick).
Gap filter & ATR offset for text positioning.
Order Blocks
ATR length and displacement multiplier.
Max lookback candles for origin OB.
Delete on mitigation / after max touches.
Bullish & Bearish zone colors and styles.
Tag & Visualization
Exclusive tags (avoid duplicates).
Label offsets (Internal vs External).
Anti-duplication filter (bars + ATR tolerance).
🔹 Use Cases
Identify trend direction via market structure breaks (Internal = short-term, External = higher timeframe).
Spot order block zones for potential entries and rejections.
Combine with price action, volume, or other SMC tools for confluence.
Ideal for scalpers, intraday, and swing traders on XAUUSD and other assets.
⚠️ Disclaimer
This tool is for educational purposes only. It does not guarantee profits and should be used with proper risk management and confluence from your trading strategy.
This indicator is designed for Smart Money Concepts (SMC) traders who want a clean, automated view of both Order Blocks (OBs) and Market Structure (MS) breaks on any chart.
It combines internal vs. external structure detection with displacement-based order block logic, ensuring precise levels with minimal noise.
🔹 Features
Internal & External Market Structure
Detects swing highs/lows with customizable pivot settings.
Identifies BOS (Break of Structure) vs CHoCH (Change of Character).
Clear visual tags with color-coded breaks.
Option to display Internal only, External only, or Both.
Exclusive Tag Logic
Avoids duplicate text when both Internal & External break on the same bar.
Choose your preference: Internal priority or External priority.
Optional de-duplication filter (ATR-based + bar lookback).
Order Blocks (OBs)
Automatic detection based on displacement × ATR.
Bullish and bearish OB zones with configurable styling.
Median line (optional) for refined entry targeting.
Automatic deletion after mitigation or X touches (user-defined).
Maximum zones displayed (for chart clarity).
Smart Filtering
Break confirmation can be based on candle close or wick touch.
Minimum displacement filter relative to ATR.
Gap filter to avoid false breaks.
🔹 Inputs
Market Structure
Internal vs External swing lengths.
Break confirmation method (Close / Wick).
Gap filter & ATR offset for text positioning.
Order Blocks
ATR length and displacement multiplier.
Max lookback candles for origin OB.
Delete on mitigation / after max touches.
Bullish & Bearish zone colors and styles.
Tag & Visualization
Exclusive tags (avoid duplicates).
Label offsets (Internal vs External).
Anti-duplication filter (bars + ATR tolerance).
🔹 Use Cases
Identify trend direction via market structure breaks (Internal = short-term, External = higher timeframe).
Spot order block zones for potential entries and rejections.
Combine with price action, volume, or other SMC tools for confluence.
Ideal for scalpers, intraday, and swing traders on XAUUSD and other assets.
⚠️ Disclaimer
This tool is for educational purposes only. It does not guarantee profits and should be used with proper risk management and confluence from your trading strategy.
Mã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
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ã được bảo vệ
Tập lệnh này được đăng dưới dạng mã nguồn đóng. Tuy nhiên, bạn có thể tự do sử dụng tập lệnh mà không có bất kỳ hạn chế nào – tìm hiểu thêm tại đây.
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.