PROTECTED SOURCE SCRIPT
SMT (ICT Concepts)

Overview
Smart Money Technique (SMT) Divergence is a price action analysis method derived from Inner Circle Trader (ICT) methodology. This indicator automatically detects SMT divergences by comparing price movements across correlated financial instruments, identifying moments when assets that typically move together begin to diverge - a phenomenon often associated with potential price reversals.
An SMT divergence occurs when one instrument makes a new swing high or low while a correlated instrument fails to confirm that move. This failure to confirm suggests that the instrument may be positioning for a reversal, as the divergence indicates a lack of conviction in the current price direction across related markets.

Theoretical Foundation
What is SMT Divergence?
In correlated markets, instruments tend to move in tandem. For example, the E-mini S&P 500 (ES) and E-mini Nasdaq 100 (NQ) futures typically make swing highs and lows together due to their shared exposure to U.S. equity markets. When this correlation breaks down at key swing points, it creates an SMT divergence.
Bullish SMT Divergence:
The chart instrument creates a lower low compared to a previous swing low, while the correlated comparison instrument creates a higher low (or fails to make a lower low). This divergence at the lows suggests potential buying pressure and a possible bullish reversal.

Bearish SMT Divergence:
The chart instrument creates a higher high compared to a previous swing high, while the correlated comparison instrument creates a lower high (or fails to make a higher high). This divergence at the highs suggests potential selling pressure and a possible bearish reversal.

Why SMT Divergences Matter
SMT divergences are considered significant because they may indicate:
Accumulation or distribution occurring in one instrument but not the other
Relative strength or weakness between correlated assets
Potential exhaustion of the current trend
Early warning signs before major reversals
Indicator Features
Multi-Timeframe SMT Detection
This indicator provides simultaneous SMT detection on two timeframes:
Current Timeframe (CTF) Detection:
The indicator scans for SMT divergences on the chart's active timeframe using multiple pivot lookback periods (3, 5, 8, 13, 21, and 34 bars). This multi-period approach ensures detection of both short-term and intermediate swing points, reducing the likelihood of missing valid divergences while filtering out noise.

Higher Timeframe (HTF) Detection:
Simultaneously, the indicator monitors a higher timeframe for SMT divergences using pivot periods of 3, 5, 8, 13, and 21 HTF candles. Higher timeframe signals generally carry more significance as they represent larger market structure.

Automatic Timeframe Pairing:
When enabled, the indicator automatically selects an appropriate higher timeframe based on your chart's current timeframe:
Sub-1 minute charts pair with 5-minute
1-2 minute charts pair with 15-minute
3-4 minute charts pair with 30-minute
5 minute charts pair with 1-hour
6-9 minute charts pair with 1-hour
15 minute charts pair with 4-hour
16-59 minute charts pair with Daily
1-4 hour charts pair with Weekly
Daily charts pair with Monthly
Combined Signal Detection:
When an SMT divergence is detected on both the current timeframe and higher timeframe at the same price pivots, the indicator combines these into a single enhanced signal. Combined signals display both timeframes in the label and use the higher timeframe styling to emphasize their increased significance.

Automatic Symbol Correlation
The indicator includes comprehensive automatic symbol selection based on the instrument you are viewing. When Auto SMT is enabled, the indicator intelligently selects correlated comparison symbols.
Index Futures Correlations:
E-mini Contracts:
NQ (Nasdaq 100) compares with ES (S&P 500) and YM (Dow Jones)
ES (S&P 500) compares with NQ (Nasdaq 100) and YM (Dow Jones)
YM (Dow Jones) compares with NQ (Nasdaq 100) and ES (S&P 500)
RTY (Russell 2000) compares with ES (S&P 500) and NQ (Nasdaq 100)
Micro Contracts:
MNQ (Micro Nasdaq) compares with MES (Micro S&P) and MYM (Micro Dow)
MES (Micro S&P) compares with MNQ (Micro Nasdaq) and MYM (Micro Dow)
MYM (Micro Dow) compares with MNQ (Micro Nasdaq) and MES (Micro S&P)
M2K (Micro Russell) compares with MES (Micro S&P) and MNQ (Micro Nasdaq)
Metals Futures Correlations:
Standard Contracts:
GC (Gold) compares with SI (Silver) and PL (Platinum)
SI (Silver) compares with GC (Gold) and PL (Platinum)
PL (Platinum) compares with GC (Gold) and SI (Silver)
Micro Contracts:
MGC (Micro Gold) compares with SIL (Micro Silver) and PL (Platinum)
SIL (Micro Silver) compares with MGC (Micro Gold) and PL (Platinum)
Energy Futures Correlations:
CL (Crude Oil) compares with RB (RBOB Gasoline) and NG (Natural Gas)
RB (RBOB Gasoline) compares with CL (Crude Oil) and NG (Natural Gas)
NG (Natural Gas) compares with CL (Crude Oil) and RB (RBOB Gasoline)
MCL (Micro Crude) compares with RB (RBOB Gasoline) and NG (Natural Gas)
Major ETF Correlations:
SPY (S&P 500 ETF) compares with QQQ, DIA, and IWM
QQQ (Nasdaq 100 ETF) compares with SPY, DIA, and IWM
DIA (Dow Jones ETF) compares with SPY, QQQ, and IWM
IWM (Russell 2000 ETF) compares with SPY, QQQ, and DIA

Stock Sector Mapping:
When viewing individual stocks, the indicator automatically identifies the stock's sector and selects appropriate sector ETFs for comparison:
Technology Sector (AAPL, MSFT, GOOGL, NVDA, AMD, INTC, etc.):
Primary: QQQ (Nasdaq 100 ETF)
Secondary: XLK (Technology Select Sector SPDR)
Tertiary: SPY (S&P 500 ETF)
Financial Sector (JPM, BAC, GS, MS, WFC, etc.):
Primary: XLF (Financial Select Sector SPDR)
Secondary: KBE (SPDR S&P Bank ETF)
Tertiary: SPY (S&P 500 ETF)
Energy Sector (XOM, CVX, COP, SLB, etc.):
Primary: XLE (Energy Select Sector SPDR)
Secondary: USO (United States Oil Fund)
Tertiary: SPY (S&P 500 ETF)
Healthcare Sector (JNJ, UNH, PFE, MRK, LLY, etc.):
Primary: XLV (Health Care Select Sector SPDR)
Secondary: IBB (iShares Biotechnology ETF)
Tertiary: SPY (S&P 500 ETF)
Consumer Discretionary Sector (TSLA, HD, NKE, MCD, etc.):
Primary: XLY (Consumer Discretionary Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)
Consumer Staples Sector (PG, KO, PEP, WMT, COST, etc.):
Primary: XLP (Consumer Staples Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)
Industrial Sector (CAT, BA, HON, UPS, etc.):
Primary: XLI (Industrial Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)
Materials Sector (LIN, APD, SHW, FCX, NEM, etc.):
Primary: XLB (Materials Select Sector SPDR)
Secondary: GLD (SPDR Gold Shares)
Tertiary: SPY (S&P 500 ETF)
Utilities Sector (NEE, DUK, SO, etc.):
Primary: XLU (Utilities Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)
Real Estate Sector (AMT, PLD, CCI, etc.):
Primary: XLRE (Real Estate Select Sector SPDR)
Secondary: VNQ (Vanguard Real Estate ETF)
Tertiary: SPY (S&P 500 ETF)
Communication Services Sector (NFLX, DIS, CMCSA, VZ, T, etc.):
Primary: XLC (Communication Services Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)

Forex Correlations:
EURUSD compares with GBPUSD
GBPUSD compares with EURUSD
Cryptocurrency Correlations:
BTCUSD compares with ETHUSD
ETHUSD compares with BTCUSD
Three-Symbol Comparison
The indicator supports comparison against up to three symbols simultaneously. When multiple comparison symbols show divergence at the same pivot point, all diverging symbols are displayed in the label, providing stronger confluence. For example, if NQ shows divergence with both ES and YM at the same swing high, the label will display "ES1! + YM1!" indicating divergence confirmation from multiple correlated instruments.
Invalidation Logic
SMT divergences are not indefinitely valid. The indicator includes automatic invalidation logic based on price action following the divergence signal.
Invalidation Rules:
Bearish SMT: Invalidates when price trades above the high of the confirmation pivot (right side of the divergence)
Bullish SMT: Invalidates when price trades below the low of the confirmation pivot (right side of the divergence)
The invalidation level is set at the confirmation bar (the second pivot that completes the SMT pattern), not the extreme of both pivots. This approach aligns with the concept that once price exceeds the confirmation point, the divergence setup is no longer valid.
Invalidation Display Options:
Users can choose to show or hide invalidated SMT signals separately for current timeframe and higher timeframe divergences. When shown, invalidated signals can be displayed with different line styles and widths to visually distinguish them from active signals. Separate limits prevent excessive invalidated signals from cluttering the chart (maximum 15 invalidated signals per timeframe type).
Input Settings
General Settings
Enable SMT Detection:
Master toggle to enable or disable all SMT divergence detection. When disabled, no SMT signals will be calculated or displayed.
Direction:
Filter which divergence types to display:
Both: Display both bullish and bearish SMT divergences
Bullish: Display only bullish SMT divergences (divergence at lows)
Bearish: Display only bearish SMT divergences (divergence at highs)
Symbol Settings
Enable Auto SMT:
When enabled, the indicator automatically selects correlated comparison symbols based on the chart instrument using the correlation mappings described above. When disabled, manual symbol inputs are used.
Symbol 1 (with enable toggle):
First comparison symbol. Enabled by default. When Auto SMT is disabled, enter the desired symbol manually.
Symbol 2 (with enable toggle):
Second comparison symbol. Enabled by default. When Auto SMT is disabled, enter the desired symbol manually.
Symbol 3 (with enable toggle):
Third comparison symbol. Disabled by default. Enable for additional confirmation from a third correlated instrument.
Current Timeframe SMT Settings
Show Current TF SMTs:
Toggle visibility of SMT divergences detected on the chart's current timeframe.
Bullish Color:
Color for bullish SMT divergence lines and labels on the current timeframe.
Bearish Color:
Color for bearish SMT divergence lines and labels on the current timeframe.
Line Style:
Style for current timeframe SMT lines (solid, dashed, or dotted).
Line Width:
Width of current timeframe SMT lines (1-4 pixels).
Show Labels:
Toggle visibility of labels on current timeframe SMT divergences.
Label Style:
Normal: Displays full information including timeframe and diverging symbol names
+/-: Displays minimal "+" or "-" characters with full information available in hover tooltip
Label Size:
Size of current timeframe SMT labels (Tiny, Small, Normal, or Large).
Show Invalidated:
Toggle visibility of invalidated current timeframe SMT signals.
Invalidated Line Style:
Line style for invalidated current timeframe SMT signals.
Invalidated Line Width:
Line width for invalidated current timeframe SMT signals.
Higher Timeframe SMT Settings
Show Higher TF SMTs:
Toggle visibility of SMT divergences detected on the higher timeframe.
Auto Timeframe:
When enabled, automatically selects an appropriate higher timeframe based on the chart's current timeframe. When disabled, uses the manually specified timeframe.
Manual Timeframe:
When Auto Timeframe is disabled, specify the higher timeframe to scan for SMT divergences.
Bullish Color:
Color for bullish SMT divergence lines and labels on the higher timeframe.
Bearish Color:
Color for bearish SMT divergence lines and labels on the higher timeframe.
Line Style:
Style for higher timeframe SMT lines (solid, dashed, or dotted).
Line Width:
Width of higher timeframe SMT lines (1-4 pixels).
Show Labels:
Toggle visibility of labels on higher timeframe SMT divergences.
Label Style:
Normal: Displays full information including timeframe and diverging symbol names
+/-: Displays minimal "+" or "-" characters with full information available in hover tooltip
Label Size:
Size of higher timeframe SMT labels (Tiny, Small, Normal, or Large).
Show Invalidated:
Toggle visibility of invalidated higher timeframe SMT signals.
Invalidated Line Style:
Line style for invalidated higher timeframe SMT signals.
Invalidated Line Width:
Line width for invalidated higher timeframe SMT signals.
Visual Representation
Line Display
SMT divergences are displayed as lines connecting the two pivot points that form the divergence:
For bearish SMT: A line connects the previous swing high to the current (higher) swing high
For bullish SMT: A line connects the previous swing low to the current (lower) swing low
The line color indicates the divergence type (bullish or bearish) and whether it was detected on the current timeframe or higher timeframe.
Label Display
Labels are positioned at the midpoint of the SMT line and display:
The timeframe on which the divergence was detected
The symbol(s) that showed divergence with the chart instrument
When using the "+/-" label style, labels show only "+" for bullish or "-" for bearish divergences, with full information accessible via hover tooltip.
All labels use monospace font formatting for consistent visual appearance.
Combined Signals
When the same divergence is detected on both current and higher timeframes, the signals are combined into a single display using higher timeframe styling. The label shows both timeframes (e.g., "M2 + M15") and all diverging symbols, indicating strong multi-timeframe confluence.
Practical Application Guidelines
Signal Interpretation
SMT divergences should be interpreted within the broader market context. Consider the following when evaluating signals:
Market Structure: SMT divergences occurring at key structural levels (previous highs/lows, order blocks, fair value gaps) tend to be more significant.
Timeframe Confluence: Signals appearing on multiple timeframes simultaneously suggest stronger institutional involvement.
Symbol Confluence: Divergences confirmed by multiple comparison symbols indicate broader market disagreement with the current price direction.
Time of Day: SMT divergences during high-volume trading sessions may carry more weight than those during low-liquidity periods.
Limitations and Considerations
Correlation Variability: Correlations between instruments can strengthen or weaken over time. The automatic symbol selection is based on typical correlations but may not always reflect current market conditions.
Pivot Detection Lag: Pivots are only confirmed after subsequent price action, meaning SMT signals appear with some delay after the actual swing point forms.
False Signals: Not all SMT divergences result in reversals. Use additional confirmation methods and proper risk management.
Data Requirements: The indicator requires sufficient historical data and may not function properly on instruments with limited price history.
Technical Notes
The indicator uses multiple pivot detection periods to identify swing points across different scales
Higher timeframe candle tracking is performed on the lower timeframe chart for precise pivot bar indexing
A deduplication system prevents the same divergence from being detected multiple times across different pivot periods
Array-based storage manages active and invalidated SMT signals with automatic cleanup to prevent memory issues
Maximum label and line counts are set to 500 each to accommodate extended analysis periods
Disclaimer
This indicator is provided for educational and informational purposes only. It is designed to assist traders in identifying potential SMT divergences based on historical price data and should not be considered as financial advice or a recommendation to buy or sell any financial instrument.
Trading financial markets involves substantial risk of loss and is not suitable for all investors. Past performance of any trading methodology, including concepts discussed in this indicator, does not guarantee future results. Users should conduct their own research and analysis before making any trading decisions.
The automatic symbol correlations and sector mappings are based on general market relationships and may not accurately reflect current or future correlations. Users are encouraged to verify correlations independently and adjust comparison symbols as needed.
Always use appropriate risk management techniques, including but not limited to position sizing and stop-loss orders. Never risk more capital than you can afford to lose.
Smart Money Technique (SMT) Divergence is a price action analysis method derived from Inner Circle Trader (ICT) methodology. This indicator automatically detects SMT divergences by comparing price movements across correlated financial instruments, identifying moments when assets that typically move together begin to diverge - a phenomenon often associated with potential price reversals.
An SMT divergence occurs when one instrument makes a new swing high or low while a correlated instrument fails to confirm that move. This failure to confirm suggests that the instrument may be positioning for a reversal, as the divergence indicates a lack of conviction in the current price direction across related markets.
Theoretical Foundation
What is SMT Divergence?
In correlated markets, instruments tend to move in tandem. For example, the E-mini S&P 500 (ES) and E-mini Nasdaq 100 (NQ) futures typically make swing highs and lows together due to their shared exposure to U.S. equity markets. When this correlation breaks down at key swing points, it creates an SMT divergence.
Bullish SMT Divergence:
The chart instrument creates a lower low compared to a previous swing low, while the correlated comparison instrument creates a higher low (or fails to make a lower low). This divergence at the lows suggests potential buying pressure and a possible bullish reversal.
Bearish SMT Divergence:
The chart instrument creates a higher high compared to a previous swing high, while the correlated comparison instrument creates a lower high (or fails to make a higher high). This divergence at the highs suggests potential selling pressure and a possible bearish reversal.
Why SMT Divergences Matter
SMT divergences are considered significant because they may indicate:
Accumulation or distribution occurring in one instrument but not the other
Relative strength or weakness between correlated assets
Potential exhaustion of the current trend
Early warning signs before major reversals
Indicator Features
Multi-Timeframe SMT Detection
This indicator provides simultaneous SMT detection on two timeframes:
Current Timeframe (CTF) Detection:
The indicator scans for SMT divergences on the chart's active timeframe using multiple pivot lookback periods (3, 5, 8, 13, 21, and 34 bars). This multi-period approach ensures detection of both short-term and intermediate swing points, reducing the likelihood of missing valid divergences while filtering out noise.
Higher Timeframe (HTF) Detection:
Simultaneously, the indicator monitors a higher timeframe for SMT divergences using pivot periods of 3, 5, 8, 13, and 21 HTF candles. Higher timeframe signals generally carry more significance as they represent larger market structure.
Automatic Timeframe Pairing:
When enabled, the indicator automatically selects an appropriate higher timeframe based on your chart's current timeframe:
Sub-1 minute charts pair with 5-minute
1-2 minute charts pair with 15-minute
3-4 minute charts pair with 30-minute
5 minute charts pair with 1-hour
6-9 minute charts pair with 1-hour
15 minute charts pair with 4-hour
16-59 minute charts pair with Daily
1-4 hour charts pair with Weekly
Daily charts pair with Monthly
Combined Signal Detection:
When an SMT divergence is detected on both the current timeframe and higher timeframe at the same price pivots, the indicator combines these into a single enhanced signal. Combined signals display both timeframes in the label and use the higher timeframe styling to emphasize their increased significance.
Automatic Symbol Correlation
The indicator includes comprehensive automatic symbol selection based on the instrument you are viewing. When Auto SMT is enabled, the indicator intelligently selects correlated comparison symbols.
Index Futures Correlations:
E-mini Contracts:
NQ (Nasdaq 100) compares with ES (S&P 500) and YM (Dow Jones)
ES (S&P 500) compares with NQ (Nasdaq 100) and YM (Dow Jones)
YM (Dow Jones) compares with NQ (Nasdaq 100) and ES (S&P 500)
RTY (Russell 2000) compares with ES (S&P 500) and NQ (Nasdaq 100)
Micro Contracts:
MNQ (Micro Nasdaq) compares with MES (Micro S&P) and MYM (Micro Dow)
MES (Micro S&P) compares with MNQ (Micro Nasdaq) and MYM (Micro Dow)
MYM (Micro Dow) compares with MNQ (Micro Nasdaq) and MES (Micro S&P)
M2K (Micro Russell) compares with MES (Micro S&P) and MNQ (Micro Nasdaq)
Metals Futures Correlations:
Standard Contracts:
GC (Gold) compares with SI (Silver) and PL (Platinum)
SI (Silver) compares with GC (Gold) and PL (Platinum)
PL (Platinum) compares with GC (Gold) and SI (Silver)
Micro Contracts:
MGC (Micro Gold) compares with SIL (Micro Silver) and PL (Platinum)
SIL (Micro Silver) compares with MGC (Micro Gold) and PL (Platinum)
Energy Futures Correlations:
CL (Crude Oil) compares with RB (RBOB Gasoline) and NG (Natural Gas)
RB (RBOB Gasoline) compares with CL (Crude Oil) and NG (Natural Gas)
NG (Natural Gas) compares with CL (Crude Oil) and RB (RBOB Gasoline)
MCL (Micro Crude) compares with RB (RBOB Gasoline) and NG (Natural Gas)
Major ETF Correlations:
SPY (S&P 500 ETF) compares with QQQ, DIA, and IWM
QQQ (Nasdaq 100 ETF) compares with SPY, DIA, and IWM
DIA (Dow Jones ETF) compares with SPY, QQQ, and IWM
IWM (Russell 2000 ETF) compares with SPY, QQQ, and DIA
Stock Sector Mapping:
When viewing individual stocks, the indicator automatically identifies the stock's sector and selects appropriate sector ETFs for comparison:
Technology Sector (AAPL, MSFT, GOOGL, NVDA, AMD, INTC, etc.):
Primary: QQQ (Nasdaq 100 ETF)
Secondary: XLK (Technology Select Sector SPDR)
Tertiary: SPY (S&P 500 ETF)
Financial Sector (JPM, BAC, GS, MS, WFC, etc.):
Primary: XLF (Financial Select Sector SPDR)
Secondary: KBE (SPDR S&P Bank ETF)
Tertiary: SPY (S&P 500 ETF)
Energy Sector (XOM, CVX, COP, SLB, etc.):
Primary: XLE (Energy Select Sector SPDR)
Secondary: USO (United States Oil Fund)
Tertiary: SPY (S&P 500 ETF)
Healthcare Sector (JNJ, UNH, PFE, MRK, LLY, etc.):
Primary: XLV (Health Care Select Sector SPDR)
Secondary: IBB (iShares Biotechnology ETF)
Tertiary: SPY (S&P 500 ETF)
Consumer Discretionary Sector (TSLA, HD, NKE, MCD, etc.):
Primary: XLY (Consumer Discretionary Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)
Consumer Staples Sector (PG, KO, PEP, WMT, COST, etc.):
Primary: XLP (Consumer Staples Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)
Industrial Sector (CAT, BA, HON, UPS, etc.):
Primary: XLI (Industrial Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)
Materials Sector (LIN, APD, SHW, FCX, NEM, etc.):
Primary: XLB (Materials Select Sector SPDR)
Secondary: GLD (SPDR Gold Shares)
Tertiary: SPY (S&P 500 ETF)
Utilities Sector (NEE, DUK, SO, etc.):
Primary: XLU (Utilities Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)
Real Estate Sector (AMT, PLD, CCI, etc.):
Primary: XLRE (Real Estate Select Sector SPDR)
Secondary: VNQ (Vanguard Real Estate ETF)
Tertiary: SPY (S&P 500 ETF)
Communication Services Sector (NFLX, DIS, CMCSA, VZ, T, etc.):
Primary: XLC (Communication Services Select Sector SPDR)
Secondary: SPY (S&P 500 ETF)
Tertiary: QQQ (Nasdaq 100 ETF)
Forex Correlations:
EURUSD compares with GBPUSD
GBPUSD compares with EURUSD
Cryptocurrency Correlations:
BTCUSD compares with ETHUSD
ETHUSD compares with BTCUSD
Three-Symbol Comparison
The indicator supports comparison against up to three symbols simultaneously. When multiple comparison symbols show divergence at the same pivot point, all diverging symbols are displayed in the label, providing stronger confluence. For example, if NQ shows divergence with both ES and YM at the same swing high, the label will display "ES1! + YM1!" indicating divergence confirmation from multiple correlated instruments.
Invalidation Logic
SMT divergences are not indefinitely valid. The indicator includes automatic invalidation logic based on price action following the divergence signal.
Invalidation Rules:
Bearish SMT: Invalidates when price trades above the high of the confirmation pivot (right side of the divergence)
Bullish SMT: Invalidates when price trades below the low of the confirmation pivot (right side of the divergence)
The invalidation level is set at the confirmation bar (the second pivot that completes the SMT pattern), not the extreme of both pivots. This approach aligns with the concept that once price exceeds the confirmation point, the divergence setup is no longer valid.
Invalidation Display Options:
Users can choose to show or hide invalidated SMT signals separately for current timeframe and higher timeframe divergences. When shown, invalidated signals can be displayed with different line styles and widths to visually distinguish them from active signals. Separate limits prevent excessive invalidated signals from cluttering the chart (maximum 15 invalidated signals per timeframe type).
Input Settings
General Settings
Enable SMT Detection:
Master toggle to enable or disable all SMT divergence detection. When disabled, no SMT signals will be calculated or displayed.
Direction:
Filter which divergence types to display:
Both: Display both bullish and bearish SMT divergences
Bullish: Display only bullish SMT divergences (divergence at lows)
Bearish: Display only bearish SMT divergences (divergence at highs)
Symbol Settings
Enable Auto SMT:
When enabled, the indicator automatically selects correlated comparison symbols based on the chart instrument using the correlation mappings described above. When disabled, manual symbol inputs are used.
Symbol 1 (with enable toggle):
First comparison symbol. Enabled by default. When Auto SMT is disabled, enter the desired symbol manually.
Symbol 2 (with enable toggle):
Second comparison symbol. Enabled by default. When Auto SMT is disabled, enter the desired symbol manually.
Symbol 3 (with enable toggle):
Third comparison symbol. Disabled by default. Enable for additional confirmation from a third correlated instrument.
Current Timeframe SMT Settings
Show Current TF SMTs:
Toggle visibility of SMT divergences detected on the chart's current timeframe.
Bullish Color:
Color for bullish SMT divergence lines and labels on the current timeframe.
Bearish Color:
Color for bearish SMT divergence lines and labels on the current timeframe.
Line Style:
Style for current timeframe SMT lines (solid, dashed, or dotted).
Line Width:
Width of current timeframe SMT lines (1-4 pixels).
Show Labels:
Toggle visibility of labels on current timeframe SMT divergences.
Label Style:
Normal: Displays full information including timeframe and diverging symbol names
+/-: Displays minimal "+" or "-" characters with full information available in hover tooltip
Label Size:
Size of current timeframe SMT labels (Tiny, Small, Normal, or Large).
Show Invalidated:
Toggle visibility of invalidated current timeframe SMT signals.
Invalidated Line Style:
Line style for invalidated current timeframe SMT signals.
Invalidated Line Width:
Line width for invalidated current timeframe SMT signals.
Higher Timeframe SMT Settings
Show Higher TF SMTs:
Toggle visibility of SMT divergences detected on the higher timeframe.
Auto Timeframe:
When enabled, automatically selects an appropriate higher timeframe based on the chart's current timeframe. When disabled, uses the manually specified timeframe.
Manual Timeframe:
When Auto Timeframe is disabled, specify the higher timeframe to scan for SMT divergences.
Bullish Color:
Color for bullish SMT divergence lines and labels on the higher timeframe.
Bearish Color:
Color for bearish SMT divergence lines and labels on the higher timeframe.
Line Style:
Style for higher timeframe SMT lines (solid, dashed, or dotted).
Line Width:
Width of higher timeframe SMT lines (1-4 pixels).
Show Labels:
Toggle visibility of labels on higher timeframe SMT divergences.
Label Style:
Normal: Displays full information including timeframe and diverging symbol names
+/-: Displays minimal "+" or "-" characters with full information available in hover tooltip
Label Size:
Size of higher timeframe SMT labels (Tiny, Small, Normal, or Large).
Show Invalidated:
Toggle visibility of invalidated higher timeframe SMT signals.
Invalidated Line Style:
Line style for invalidated higher timeframe SMT signals.
Invalidated Line Width:
Line width for invalidated higher timeframe SMT signals.
Visual Representation
Line Display
SMT divergences are displayed as lines connecting the two pivot points that form the divergence:
For bearish SMT: A line connects the previous swing high to the current (higher) swing high
For bullish SMT: A line connects the previous swing low to the current (lower) swing low
The line color indicates the divergence type (bullish or bearish) and whether it was detected on the current timeframe or higher timeframe.
Label Display
Labels are positioned at the midpoint of the SMT line and display:
The timeframe on which the divergence was detected
The symbol(s) that showed divergence with the chart instrument
When using the "+/-" label style, labels show only "+" for bullish or "-" for bearish divergences, with full information accessible via hover tooltip.
All labels use monospace font formatting for consistent visual appearance.
Combined Signals
When the same divergence is detected on both current and higher timeframes, the signals are combined into a single display using higher timeframe styling. The label shows both timeframes (e.g., "M2 + M15") and all diverging symbols, indicating strong multi-timeframe confluence.
Practical Application Guidelines
Signal Interpretation
SMT divergences should be interpreted within the broader market context. Consider the following when evaluating signals:
Market Structure: SMT divergences occurring at key structural levels (previous highs/lows, order blocks, fair value gaps) tend to be more significant.
Timeframe Confluence: Signals appearing on multiple timeframes simultaneously suggest stronger institutional involvement.
Symbol Confluence: Divergences confirmed by multiple comparison symbols indicate broader market disagreement with the current price direction.
Time of Day: SMT divergences during high-volume trading sessions may carry more weight than those during low-liquidity periods.
Limitations and Considerations
Correlation Variability: Correlations between instruments can strengthen or weaken over time. The automatic symbol selection is based on typical correlations but may not always reflect current market conditions.
Pivot Detection Lag: Pivots are only confirmed after subsequent price action, meaning SMT signals appear with some delay after the actual swing point forms.
False Signals: Not all SMT divergences result in reversals. Use additional confirmation methods and proper risk management.
Data Requirements: The indicator requires sufficient historical data and may not function properly on instruments with limited price history.
Technical Notes
The indicator uses multiple pivot detection periods to identify swing points across different scales
Higher timeframe candle tracking is performed on the lower timeframe chart for precise pivot bar indexing
A deduplication system prevents the same divergence from being detected multiple times across different pivot periods
Array-based storage manages active and invalidated SMT signals with automatic cleanup to prevent memory issues
Maximum label and line counts are set to 500 each to accommodate extended analysis periods
Disclaimer
This indicator is provided for educational and informational purposes only. It is designed to assist traders in identifying potential SMT divergences based on historical price data and should not be considered as financial advice or a recommendation to buy or sell any financial instrument.
Trading financial markets involves substantial risk of loss and is not suitable for all investors. Past performance of any trading methodology, including concepts discussed in this indicator, does not guarantee future results. Users should conduct their own research and analysis before making any trading decisions.
The automatic symbol correlations and sector mappings are based on general market relationships and may not accurately reflect current or future correlations. Users are encouraged to verify correlations independently and adjust comparison symbols as needed.
Always use appropriate risk management techniques, including but not limited to position sizing and stop-loss orders. Never risk more capital than you can afford to lose.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.