PROTECTED SOURCE SCRIPT
SMT Divergence w/ HTF

SMT Divergence with Higher Timeframe Indicator Overview
This script is a technical analysis tool for Trading View that identifies and visualizes Smart Money Concepts (SMT) divergences between two financial instruments across multiple timeframes. Here's a comprehensive breakdown of its functionality:
Core Purpose
The indicator detects divergences between a main symbol (the one displayed on the chart) and a comparison symbol (defined by the user, defaulting to ES futures). A divergence occurs when price movements between these two instruments show opposing patterns at pivot points.
Key Features
1. Smart Money Concepts (SMT) Divergence Detection
Identifies two types of divergences:
Bullish SMT: When one instrument makes a lower low while the other makes a higher low (or vice versa)
Bearish SMT: When one instrument makes a higher high while the other makes a lower high (or vice versa)
2. Multi-Timeframe Analysis
Analyses and displays divergences on the current chart timeframe
Provides optional overlays from higher timeframes:
Hourly (H1)
4-Hour (H4)
Daily (D)
Weekly (W)
Automatically determines which timeframes to display based on the current chart timeframe (e.g., won't show hourly divergences on an hourly chart)
3. Dynamic Pivot Detection
Calculates pivot points using a user-defined lookback period
Uses sophisticated algorithms to accurately locate pivot points across different timeframes
Maps higher timeframe pivots to corresponding price points on the current timeframe
4. Automatic Invalidation
Automatically removes divergence signals when they become invalidated by price action
For bearish SMT: Invalidated when both symbols close above their highest pivot points
For bullish SMT: Invalidated when both symbols close below their lowest pivot points
5. Visual Elements
Draws connecting lines between pivots that form divergences
Adds optional labels showing the type of divergence (bullish/bearish) and timeframe
Color-codes lines and labels (green for bullish, red for bearish by default)
Customizable colours and opacity settings
User Configuration Options
The script offers extensive customization through several input groups:
Symbols: Selection of the comparison symbol
SMT Settings: Pivot lookback timeframe and label visibility
Higher Timeframe Overlay: Toggle different timeframe overlays (H1, H4, Daily, Weekly)
Style Settings: Customize colours and opacity of visual elements
This script is a technical analysis tool for Trading View that identifies and visualizes Smart Money Concepts (SMT) divergences between two financial instruments across multiple timeframes. Here's a comprehensive breakdown of its functionality:
Core Purpose
The indicator detects divergences between a main symbol (the one displayed on the chart) and a comparison symbol (defined by the user, defaulting to ES futures). A divergence occurs when price movements between these two instruments show opposing patterns at pivot points.
Key Features
1. Smart Money Concepts (SMT) Divergence Detection
Identifies two types of divergences:
Bullish SMT: When one instrument makes a lower low while the other makes a higher low (or vice versa)
Bearish SMT: When one instrument makes a higher high while the other makes a lower high (or vice versa)
2. Multi-Timeframe Analysis
Analyses and displays divergences on the current chart timeframe
Provides optional overlays from higher timeframes:
Hourly (H1)
4-Hour (H4)
Daily (D)
Weekly (W)
Automatically determines which timeframes to display based on the current chart timeframe (e.g., won't show hourly divergences on an hourly chart)
3. Dynamic Pivot Detection
Calculates pivot points using a user-defined lookback period
Uses sophisticated algorithms to accurately locate pivot points across different timeframes
Maps higher timeframe pivots to corresponding price points on the current timeframe
4. Automatic Invalidation
Automatically removes divergence signals when they become invalidated by price action
For bearish SMT: Invalidated when both symbols close above their highest pivot points
For bullish SMT: Invalidated when both symbols close below their lowest pivot points
5. Visual Elements
Draws connecting lines between pivots that form divergences
Adds optional labels showing the type of divergence (bullish/bearish) and timeframe
Color-codes lines and labels (green for bullish, red for bearish by default)
Customizable colours and opacity settings
User Configuration Options
The script offers extensive customization through several input groups:
Symbols: Selection of the comparison symbol
SMT Settings: Pivot lookback timeframe and label visibility
Higher Timeframe Overlay: Toggle different timeframe overlays (H1, H4, Daily, Weekly)
Style Settings: Customize colours and opacity of visual elements
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.