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.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.