OPEN-SOURCE SCRIPT
SMT (DXY) DIVERGENCES

This indicator detects Smart Money Technique (SMT) Divergences between the chart symbol and up to two comparison symbols defined in the settings.
It identifies swing highs and swing lows on correlated/uncorrelated instruments, compares their highs and lows, and determines possible divergences.
🔷 What It Detects
-Bullish SMT Divergence: When the lows of the chart symbol slope in the opposite direction of the comparison symbol’s lows.
-Bearish SMT Divergence: When the highs of the chart symbol slope in the opposite direction of the comparison symbol’s highs.
-Multi-Symbol Compatibility: Ability to compare the main symbol with one or two external tickers (default: DXY and GBPUSD).
-Negative Divergence Option: The inversion feature allows comparison with opposite-moving charts.
[url=
🔷 Calculation Logic
-Swing Detection: Swing highs and lows are confirmed using pivot-based logic.
-Comparison: Slopes of highs and lows are calculated for both the chart symbol and the comparison symbols.
-Divergence Identification: If slopes point in opposite directions, an SMT divergence (bullish or bearish) is marked.
-Visualization: Lines and labels (“+ SMT” or “– SMT”) are drawn on the chart. Historical lines can be kept or cleared depending on user settings.
🔷 Visual
Bearish SMT: Downward line with “– SMT” label.
Bullish SMT: Upward line with “+ SMT” label.
Style Options: Predefined color schemes (TLAB, standard, monochrome) or fully customizable colors.
Line Style: Solid, dashed, or dotted.
[url=
🔷 Customization Options
-Show Historical: Decide whether past divergences remain visible on the chart.
-Comparison Symbols: Define up to two external tickers, with optional inversion.
-Swing Lengths: Preconfigured pivot lengths automatically adapt to the selected timeframe (Daily, 4H, 1H, 5m/15m).
-Lines & Labels: Enable or disable bullish/bearish SMT divergences and their annotations.
🔷 Indicator Usage
Select the comparison symbol with positive or negative correlation.
Wait for the “+ SMT” or “– SMT” marker to appear on the chart.
Divergences can be used as contextual confluence when studying potential market shifts:
A + SMT marker may suggest bullish divergence.
A – SMT marker may suggest bearish divergence.


It identifies swing highs and swing lows on correlated/uncorrelated instruments, compares their highs and lows, and determines possible divergences.
🔷 What It Detects
-Bullish SMT Divergence: When the lows of the chart symbol slope in the opposite direction of the comparison symbol’s lows.
-Bearish SMT Divergence: When the highs of the chart symbol slope in the opposite direction of the comparison symbol’s highs.
-Multi-Symbol Compatibility: Ability to compare the main symbol with one or two external tickers (default: DXY and GBPUSD).
-Negative Divergence Option: The inversion feature allows comparison with opposite-moving charts.
[url=
🔷 Calculation Logic
-Swing Detection: Swing highs and lows are confirmed using pivot-based logic.
-Comparison: Slopes of highs and lows are calculated for both the chart symbol and the comparison symbols.
-Divergence Identification: If slopes point in opposite directions, an SMT divergence (bullish or bearish) is marked.
-Visualization: Lines and labels (“+ SMT” or “– SMT”) are drawn on the chart. Historical lines can be kept or cleared depending on user settings.
🔷 Visual
Bearish SMT: Downward line with “– SMT” label.
Bullish SMT: Upward line with “+ SMT” label.
Style Options: Predefined color schemes (TLAB, standard, monochrome) or fully customizable colors.
Line Style: Solid, dashed, or dotted.
[url=
🔷 Customization Options
-Show Historical: Decide whether past divergences remain visible on the chart.
-Comparison Symbols: Define up to two external tickers, with optional inversion.
-Swing Lengths: Preconfigured pivot lengths automatically adapt to the selected timeframe (Daily, 4H, 1H, 5m/15m).
-Lines & Labels: Enable or disable bullish/bearish SMT divergences and their annotations.
🔷 Indicator Usage
Select the comparison symbol with positive or negative correlation.
Wait for the “+ SMT” or “– SMT” marker to appear on the chart.
Divergences can be used as contextual confluence when studying potential market shifts:
A + SMT marker may suggest bullish divergence.
A – SMT marker may suggest bearish divergence.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。