OPEN-SOURCE SCRIPT
RealVardi - SMT Divergence - NQ vs ES

SMT Divergence — NQ vs ES
This indicator detects Smart Money Technique (SMT) divergences between Nasdaq (NQ) and S&P 500 (ES) futures — a concept popularized in ICT methodology. When two correlated instruments stop moving in sync at key swing points, it often signals that institutional order flow is shifting, providing early clues about potential reversals.
How It Works
The indicator identifies confirmed swing highs and swing lows on both NQ and ES using a user-defined lookback period. It then compares consecutive pivots across both instruments to detect divergences:
Bearish SMT — NQ prints a higher high while ES prints a lower high. This failure by ES to confirm NQ's new high suggests weakness and a potential move down.
Bullish SMT — NQ prints a lower low while ES prints a higher low. This failure by ES to confirm NQ's new low suggests strength and a potential move up.
A proximity filter ensures that only swing points occurring within a reasonable window of each other are compared, keeping signals relevant.
Features
Works on any timeframe
Optional Higher Timeframe (HTF) bias filter — only show bullish signals when the HTF candle is bullish, and bearish signals when bearish, to trade in the direction of the larger trend
Customizable swing lookback length to tune sensitivity
Toggle bullish and bearish signals independently
Built-in alert conditions for all signal types
Labels are time-anchored so they stay fixed when scrolling
Inputs
ES Symbol — the correlated pair to compare against (default: ES1!)
Swing Lookback Length — number of bars on each side to confirm a pivot (default: 10)
HTF Filter — optional higher timeframe candle direction filter
Colors & Label Size — fully customizable appearance
How To Use
SMT divergences are most effective when combined with other confluence factors such as liquidity sweeps, order blocks, fair value gaps, or key support/resistance levels. Use them as confirmation rather than standalone entry signals. The HTF filter can help reduce noise by aligning signals with the broader market direction.
Default Pair: NQ vs ES — You can change the comparison symbol in the settings to explore divergences between other correlated instruments.
This indicator detects Smart Money Technique (SMT) divergences between Nasdaq (NQ) and S&P 500 (ES) futures — a concept popularized in ICT methodology. When two correlated instruments stop moving in sync at key swing points, it often signals that institutional order flow is shifting, providing early clues about potential reversals.
How It Works
The indicator identifies confirmed swing highs and swing lows on both NQ and ES using a user-defined lookback period. It then compares consecutive pivots across both instruments to detect divergences:
Bearish SMT — NQ prints a higher high while ES prints a lower high. This failure by ES to confirm NQ's new high suggests weakness and a potential move down.
Bullish SMT — NQ prints a lower low while ES prints a higher low. This failure by ES to confirm NQ's new low suggests strength and a potential move up.
A proximity filter ensures that only swing points occurring within a reasonable window of each other are compared, keeping signals relevant.
Features
Works on any timeframe
Optional Higher Timeframe (HTF) bias filter — only show bullish signals when the HTF candle is bullish, and bearish signals when bearish, to trade in the direction of the larger trend
Customizable swing lookback length to tune sensitivity
Toggle bullish and bearish signals independently
Built-in alert conditions for all signal types
Labels are time-anchored so they stay fixed when scrolling
Inputs
ES Symbol — the correlated pair to compare against (default: ES1!)
Swing Lookback Length — number of bars on each side to confirm a pivot (default: 10)
HTF Filter — optional higher timeframe candle direction filter
Colors & Label Size — fully customizable appearance
How To Use
SMT divergences are most effective when combined with other confluence factors such as liquidity sweeps, order blocks, fair value gaps, or key support/resistance levels. Use them as confirmation rather than standalone entry signals. The HTF filter can help reduce noise by aligning signals with the broader market direction.
Default Pair: NQ vs ES — You can change the comparison symbol in the settings to explore divergences between other correlated instruments.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.