Overview
This indicator detects ICT SMT (Smart Money Technique) Divergence — a cross-symbol analysis method that compares swing highs and lows between correlated instruments to identify institutional manipulation. When one instrument makes a new extreme but its correlated pair fails to confirm, it signals that smart money is positioned on the opposite side. The indicator automatically pairs common instruments (ES/NQ, EUR/GBP, DXY inverse) and supports custom symbol input for any pair.
Key Concepts
- SMT Divergence (Smart Money Technique) — ICT's method of comparing price structure across correlated instruments. When two instruments that normally move together create different structure (one makes a higher high while the other makes a lower high), it reveals institutional manipulation. The "weaker" instrument that fails to confirm the new extreme reveals the real direction of smart money.
- Bearish SMT Divergence — The main instrument makes a Higher High, but the correlated instrument makes a Lower High. This indicates that institutional participants are distributing (selling) rather than chasing the new high. The higher high on the main symbol is a trap — smart money is positioned short.
- Bullish SMT Divergence — The main instrument makes a Lower Low, but the correlated instrument makes a Higher Low. This indicates that institutional participants are accumulating (buying) rather than participating in the new low. The lower low on the main symbol is a stop hunt — smart money is positioned long.
- Correlated Instrument Pairs — ICT uses specific instrument pairs for SMT analysis: ES (S&P 500) and NQ (Nasdaq 100) for index futures, EUR/USD and GBP/USD for forex majors, and DXY (US Dollar Index) as an inverse correlation reference. Any instruments with known correlation or inverse correlation can be used.
- Inverse Correlation — For inversely correlated pairs (e.g., DXY vs EUR/USD), the divergence logic is inverted. When DXY makes a higher high and EUR/USD makes a higher low (instead of the expected lower low), it signals the same type of divergence — the move is not being confirmed across markets.
How It Works
1. Auto Pair Detection The indicator automatically detects the appropriate comparison symbol based on the current chart: — Index Futures mode: ES ↔ NQ, YM → ES, RTY → ES, ZN ↔ ZB (Bond market, ICT §14.4) — Forex Majors mode: EUR/USD ↔ GBP/USD, AUD/USD ↔ NZD/USD, USD/JPY ↔ USD/CHF — DXY Inverse mode: Any pair vs DXY with inverted logic — Custom mode: User specifies any symbol and chooses positive or inverse correlationThe comparison symbol's price data is retrieved via request.security() on the same timeframe as the chart.
2. Swing Detection The indicator uses ta.pivothigh() and ta.pivotlow() with a configurable lookback (default 5 bars each side) to identify confirmed swing highs and lows on both the main and comparison symbols. All detected swings are stored in arrays for comparison. The swing detection produces results with a delay equal to the lookback — swings are confirmed only after enough bars have passed on both sides.
Critically, the indicator uses temporal alignment to find the comparison swing nearest in time to each main swing. This prevents false signals from comparing swings that occurred at very different times. The Temporal Alignment Tolerance setting (default 10 bars) controls the maximum allowed time gap between matched swings.
Distance filters ensure the two swings are neither too close (noise) nor too far apart (unrelated).
4. Inverse Correlation Logic For inversely correlated pairs, the comparison is flipped. The comparison symbol's lows are used where highs would normally be checked, and vice versa. This ensures correct divergence detection for DXY-based analysis and any other inverse pair. 5. Visual Output Each detected SMT divergence is displayed with: — A colored line connecting the two swing points on the main chart — A label ("▲ SMT" or "▼ SMT") at the divergence point with a tooltip showing full details — An optional background color flash on the divergence bar — An info table showing the paired symbols, correlation type, divergence counts, and connection status
Features
- Auto Pair Detection — Automatically identifies the correct comparison symbol for ES/NQ, YM, RTY, ZN/ZB (bond market), EUR/GBP, AUD/NZD, USD/JPY/CHF, and DXY inverse pairs. No manual setup required for common instruments.
- Custom Symbol Support — Enter any TradingView symbol as the comparison instrument for custom correlation analysis. Works with stocks, crypto, commodities, or any tradable instrument.
- Inverse Correlation Mode — Automatically activated for DXY-based pairs or manually toggled for custom inversely correlated instruments. Flips the divergence logic so that inverse relationships are correctly analyzed.
- Configurable Swing Detection — Pivot-based swing detection with adjustable lookback (2–20 bars). Lower values capture more swings for responsive signals; higher values focus on major structural pivots.
- Distance Filters — Minimum and maximum bar distance between compared swings. Prevents false signals from adjacent noisy pivots and ensures the two swings are structurally related.
- Temporal Alignment — Each main swing is matched with the comparison symbol's nearest swing in time (within a configurable tolerance). This ensures that only temporally related swings are compared, eliminating false divergences from unrelated swing points.
- Divergence Lines — Colored lines connecting the two swing points that form the divergence. Bullish divergence lines connect swing lows; bearish divergence lines connect swing highs.
- Tooltip Details — Hover over any SMT label to see the full divergence breakdown: both symbols' exact price values at each swing point, the direction of divergence, and the institutional interpretation.
- Background Flash — Optional brief background color highlight on bars where a new SMT divergence is detected. Opacity is configurable.
- Info Table — Real-time table showing: main symbol, comparison symbol, correlation type (Positive/Inverse), total bullish and bearish divergence counts, and data connection status.
- Swing Point Dots — Optional debug visualization showing all detected swing highs and lows as small dots on the chart.
- Comparison Swing Dots — Optional diamond markers (◇) at comparison symbol's swing highs and lows, displayed at the corresponding bar positions on the main chart. Hover for exact comp price. Helps visualize cross-symbol swing alignment.
- Divergence Statistics — Running count of bullish and bearish SMT divergences detected over the chart's visible history.
- 2 Alert Conditions — Bullish SMT Divergence and Bearish SMT Divergence. Each alert includes both symbol names, the structure description, and the timeframe.
How to Use
- Index Futures (ES vs NQ): Open an ES1! or NQ1! chart on any timeframe. The indicator auto-pairs the two. When ES makes a higher high but NQ fails to confirm, it suggests the rally is not broad-based — potential bearish reversal. When ES makes a lower low but NQ holds higher, institutional buying is occurring — potential bullish reversal.
- Forex Majors (EUR vs GBP): Open EUR/USD or GBP/USD. The indicator auto-pairs them. These pairs are highly correlated — when one makes a new extreme that the other doesn't confirm, it signals manipulation on the failing pair.
- DXY Inverse: Select "Auto (DXY Inverse)" mode. The indicator pairs your currency pair with DXY using inverse logic. If DXY makes a new high but EUR/USD fails to make a corresponding new low, the dollar strength is not confirmed.
- Combine with ICT Concepts: SMT divergence is a confirmation tool. Use it alongside Market Structure (BOS/CHoCH), Liquidity Levels (equal highs/lows), Killzones (session timing), and Order Blocks (entry zones). An SMT divergence at a key liquidity level during a killzone is a high-probability setup.
- Timeframe Selection: ICT uses SMT on 15-minute to daily charts for swing analysis. Lower timeframes produce more signals but with less significance. Higher timeframes produce fewer, more reliable divergences.
- Custom Pairs: Select "Custom" mode to compare any two instruments. For example, compare AAPL vs QQQ, BTC vs ETH, or Gold vs Silver. Enable "Invert Comparison" for inversely correlated custom pairs.
Limitations
- SMT divergence requires data from two symbols simultaneously. If the comparison symbol has no data on the current timeframe (e.g., futures during off-market hours), divergence detection pauses. The info table's "Status" field shows "No Data" when this occurs.
- Swing detection uses a fixed lookback, meaning pivots are confirmed with a delay equal to the swing lookback setting. A setting of 5 bars means each swing is confirmed 5 bars after it forms.
- Auto pair detection uses simple string matching on the ticker symbol. Exotic broker-specific ticker formats may not match correctly — use Custom mode as a fallback.
- The indicator uses temporal alignment to match swings across symbols. If no matching comparison swing is found within the tolerance window, no divergence is signaled for that swing pair. Increasing the Temporal Alignment Tolerance setting allows for wider matching windows.
- Inverse correlation logic assumes a clean inverse relationship. In reality, correlations fluctuate — DXY and EUR/USD may temporarily decouple. Use SMT as confirmation, not as a standalone signal.
- Pine Script's request.security() retrieves data based on the chart's timeframe. The comparison symbol must have data available on TradingView for the selected timeframe.
- This indicator detects structural divergences between instruments — it does not generate buy/sell signals. Use it as a confirmation tool within a broader ICT analytical framework including Market Structure, Order Blocks, FVGs, Liquidity Levels, and Killzones.



