OPEN-SOURCE SCRIPT
ICT/SMC Sessions + SMT Divergence

Pro ICT/SMC Structural Suite: Sessions, SMT Divergence & RTH Gaps
Overview
The ICT/SMC Structural Suite is a highly optimized, "pure structure" indicator designed for traders utilizing Inner Circle Trader (ICT) and Smart Money Concepts (SMC). Unlike traditional indicators that rely on lagging oscillators or moving averages, this script focuses entirely on Time and Price Geometry.
It provides an all-in-one visual overlay for institutional trading sessions, Opening Prices, Fair Value Gaps (FVGs), real-time SMT Divergences, and a highly advanced Regular Trading Hours (RTH) Gap engine. It is engineered to be lightweight, incredibly fast, and meticulously anchored to "America/New_York" time to natively handle Daylight Saving Time (DST) shifts without user intervention.
Core Features & Technical Breakdown
1. Asset-Aware RTH Gap Engine
One of the most complex challenges in charting is accurately mapping the daily RTH gap on continuous Extended Trading Hours (ETH) charts, especially over the weekend.
The Logic: This script uses a custom state-management system to bypass the Sunday overnight session on Futures. It isolates the true Regular Trading Hours (session.regular), explicitly locking the Friday close and drawing a dynamic gap box to the Monday 09:30 AM open.
Asset-Aware: The engine dynamically reads syminfo.type. If you are trading Futures (e.g., ES/NQ), it tracks the close until 16:15 EST. If you switch to Equities (e.g., AAPL/NVDA), it automatically snaps back to 16:00 EST, preventing after-hours earnings volatility from breaking your gap levels.
Quartiles: Automatically calculates and plots the 25%, 50% (Consequent Encroachment), and 75% levels inside the gap.
2. Real-Time Multi-SMT Divergence
Traditional divergence indicators wait for a candle to close before signaling. This script utilizes a custom real-time evaluation engine.
The Logic: The script establishes historical swing points using a 5-bar pivot lookback (ta.pivothigh / ta.pivotlow). It then compares your active, live tick against those historical pivots. If the current ticker sweeps a previous high/low, but your correlated assets fail to do so, a real-time label flashes on the chart.
Customization: Supports up to 5 concurrent assets. Includes a built-in VIX tracker (auto-inversed) and 4 customizable tickers (e.g., NQ, YM, DXY) with toggleable inversion logic.
3. Institutional Time Sessions
Visualizes key accumulation and distribution zones via clean, customizable background boxes.
Tracks Equity Pre-Market (EPM), London, Asia, and CBDR (Central Bank Dealers Range).
DST Proof: All sessions are mathematically forced to America/New_York time in the background, meaning your 09:30 AM open and macro times will never drift when Daylight Saving Time begins or ends.
4. 1st AM FVG Detector
Automatically detects and highlights the very first Fair Value Gap (FVG) that forms exclusively during the opening volatility window (09:31 AM – 10:30 AM EST). This box is extended forward in time as a high-probability draw on liquidity or retracement POI for the remainder of the session.
5. ICT Macros & Opening Prices
Macros: Highlights the 14 standard ICT Macro windows (e.g., 09:50-10:10, 10:50-11:10) with non-intrusive, bottom-anchored X-axis labels to keep your price action completely uncluttered. Includes an optional End-of-Day (15:15) macro toggle.
True Daily Opens: Plots the Midnight (00:00) Open, NY (08:30) Open, and Equity (09:30) Open as extended horizontal rays.
6. Higher Timeframe (HTF) Liquidity Levels
Automatically pulls and plots the Previous Day High/Low (PDH/PDL) and Previous Week High/Low (PWH/PWL) without requiring you to change timeframes.
How to Use This Script
This indicator is not a "buy/sell" signal generator; it is a structural mapping tool designed to give you contextual awareness of institutional order flow.
Trading the RTH Gap: The RTH gap box acts as a powerful magnetic zone. Traders can look for price to rebalance into the gap, using the internal 50% line (Consequent Encroachment) as a target or a bounce level.
Validating Reversals with SMT: When price pushes into a Higher Timeframe Liquidity Level (like PDH or PWL), look for an SMT Divergence label to appear. If ES sweeps the high but NQ fails to make a higher high, the divergence adds high-probability confluence to a reversal setup.
Opening Price Lenses: Use the Midnight and 08:30 Opens as your daily bias gauge. If price is above the Midnight Open, the daily profile is expansive (bullish); look for manipulation moves below the open to accumulate longs (Judas Swing).
Under the Hood (For Pine Geeks)
This script was heavily refactored for enterprise-grade execution speed. Repetitive drawing logic has been extracted into single-pass functions, state arrays are trimmed using optimized while loops, and request.security calls are fully gated by boolean toggles to prevent API overhead when custom tickers are disabled.
Overview
The ICT/SMC Structural Suite is a highly optimized, "pure structure" indicator designed for traders utilizing Inner Circle Trader (ICT) and Smart Money Concepts (SMC). Unlike traditional indicators that rely on lagging oscillators or moving averages, this script focuses entirely on Time and Price Geometry.
It provides an all-in-one visual overlay for institutional trading sessions, Opening Prices, Fair Value Gaps (FVGs), real-time SMT Divergences, and a highly advanced Regular Trading Hours (RTH) Gap engine. It is engineered to be lightweight, incredibly fast, and meticulously anchored to "America/New_York" time to natively handle Daylight Saving Time (DST) shifts without user intervention.
Core Features & Technical Breakdown
1. Asset-Aware RTH Gap Engine
One of the most complex challenges in charting is accurately mapping the daily RTH gap on continuous Extended Trading Hours (ETH) charts, especially over the weekend.
The Logic: This script uses a custom state-management system to bypass the Sunday overnight session on Futures. It isolates the true Regular Trading Hours (session.regular), explicitly locking the Friday close and drawing a dynamic gap box to the Monday 09:30 AM open.
Asset-Aware: The engine dynamically reads syminfo.type. If you are trading Futures (e.g., ES/NQ), it tracks the close until 16:15 EST. If you switch to Equities (e.g., AAPL/NVDA), it automatically snaps back to 16:00 EST, preventing after-hours earnings volatility from breaking your gap levels.
Quartiles: Automatically calculates and plots the 25%, 50% (Consequent Encroachment), and 75% levels inside the gap.
2. Real-Time Multi-SMT Divergence
Traditional divergence indicators wait for a candle to close before signaling. This script utilizes a custom real-time evaluation engine.
The Logic: The script establishes historical swing points using a 5-bar pivot lookback (ta.pivothigh / ta.pivotlow). It then compares your active, live tick against those historical pivots. If the current ticker sweeps a previous high/low, but your correlated assets fail to do so, a real-time label flashes on the chart.
Customization: Supports up to 5 concurrent assets. Includes a built-in VIX tracker (auto-inversed) and 4 customizable tickers (e.g., NQ, YM, DXY) with toggleable inversion logic.
3. Institutional Time Sessions
Visualizes key accumulation and distribution zones via clean, customizable background boxes.
Tracks Equity Pre-Market (EPM), London, Asia, and CBDR (Central Bank Dealers Range).
DST Proof: All sessions are mathematically forced to America/New_York time in the background, meaning your 09:30 AM open and macro times will never drift when Daylight Saving Time begins or ends.
4. 1st AM FVG Detector
Automatically detects and highlights the very first Fair Value Gap (FVG) that forms exclusively during the opening volatility window (09:31 AM – 10:30 AM EST). This box is extended forward in time as a high-probability draw on liquidity or retracement POI for the remainder of the session.
5. ICT Macros & Opening Prices
Macros: Highlights the 14 standard ICT Macro windows (e.g., 09:50-10:10, 10:50-11:10) with non-intrusive, bottom-anchored X-axis labels to keep your price action completely uncluttered. Includes an optional End-of-Day (15:15) macro toggle.
True Daily Opens: Plots the Midnight (00:00) Open, NY (08:30) Open, and Equity (09:30) Open as extended horizontal rays.
6. Higher Timeframe (HTF) Liquidity Levels
Automatically pulls and plots the Previous Day High/Low (PDH/PDL) and Previous Week High/Low (PWH/PWL) without requiring you to change timeframes.
How to Use This Script
This indicator is not a "buy/sell" signal generator; it is a structural mapping tool designed to give you contextual awareness of institutional order flow.
Trading the RTH Gap: The RTH gap box acts as a powerful magnetic zone. Traders can look for price to rebalance into the gap, using the internal 50% line (Consequent Encroachment) as a target or a bounce level.
Validating Reversals with SMT: When price pushes into a Higher Timeframe Liquidity Level (like PDH or PWL), look for an SMT Divergence label to appear. If ES sweeps the high but NQ fails to make a higher high, the divergence adds high-probability confluence to a reversal setup.
Opening Price Lenses: Use the Midnight and 08:30 Opens as your daily bias gauge. If price is above the Midnight Open, the daily profile is expansive (bullish); look for manipulation moves below the open to accumulate longs (Judas Swing).
Under the Hood (For Pine Geeks)
This script was heavily refactored for enterprise-grade execution speed. Repetitive drawing logic has been extracted into single-pass functions, state arrays are trimmed using optimized while loops, and request.security calls are fully gated by boolean toggles to prevent API overhead when custom tickers are disabled.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.