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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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 sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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.