PROTECTED SOURCE SCRIPT
NWOG/NDOG [NINE Θ]

Overview
A professional-grade indicator for detecting and visualizing New Week Opening Gaps (NWOGs) and New Day Opening Gaps (NDOGs), essential concepts in ICT (Inner Circle Trader) methodology and analysis.
What Are Opening Gaps?
Opening gaps represent price inefficiencies created between trading sessions. When one session closes and the next session opens at a different price, the resulting "gap" creates a zone of unfilled orders and potential liquidity. These gaps often act as magnets for price, providing high-probability trading opportunities as the market seeks to rebalance these inefficiencies.
NWOG (New Week Opening Gap)
The gap between Friday's close and Sunday's open. These weekly imbalances are significant because they represent the collective repositioning of institutional traders over the weekend. NWOGs frequently serve as major support/resistance zones that can influence price action for days or even weeks. Due to their larger timeframe context, NWOGs typically carry more weight than daily gaps.

NDOG (New Day Opening Gap)
The gap between one session's close and the next session's open. Daily gaps occur more frequently than weekly gaps, offering more regular trading setups. While individually less significant than NWOGs, NDOGs provide valuable intraday reference points and often fill within the same trading session.

Features In Depth
Gap Detection & Visualization
The indicator automatically identifies and plots opening gaps as they form in real-time.
Automatic Detection: The indicator monitors session transitions and instantly identifies when a gap forms between the previous close and current open. NWOGs are detected on Sunday opens, while NDOGs are detected at each new daily session open (excluding Sundays, which are reserved for NWOG detection).
Bullish vs Bearish Classification: Each gap is automatically classified based on its direction:
Bullish Gap (Gap Up): Current open is higher than previous close, indicates overnight buying pressure
Bearish Gap (Gap Down): Current open is lower than previous close, indicates overnight selling pressure
The indicator uses distinct color schemes for bullish and bearish gaps, making it easy to identify gap direction at a glance. Current/most recent gaps use the "new" color settings, while historical gaps use the standard color settings.
Historical Tracking: Track up to 20 gaps of each type simultaneously. The "Historical Count" setting controls how many gaps remain visible on your chart. Older gaps are automatically removed as new ones form, keeping your chart clean while maintaining relevant historical context.
Visual Customization:
Toggle gap boundary lines (HIGH/LOW) on or off independently from the background fill
Choose line styles: solid (⎯⎯⎯), dashed (----), or dotted (····)
Adjust line thickness from 1-4 pixels
Enable/disable background fill with customizable transparency
Set colors independently for current vs historical gaps

Consequent Encroachment (C.E.)
The Consequent Encroachment represents the 50% midpoint of a gap — a critical level in ICT methodology.
Why C.E. Matters: In smart money concepts, the C.E. level represents the point of maximum efficiency within an imbalance. Price often gravitates toward this level as it seeks to rebalance the gap. Many traders use C.E. as their primary target when trading gap fills, or as a key level for entries and stop placement.
C.E. Display Options:
Independent color settings for current vs historical gaps
Separate line style and thickness controls
Can be shown/hidden independently from gap boundaries
Quarter Levels (25% and 75%): For traders who want additional precision, the indicator offers optional quarter levels at 25% and 75% of the gap range. These levels can serve as:
Partial profit targets
Scaling entry points
Additional support/resistance zones within the gap

Fill Tracking & Percentage
The indicator provides sophisticated fill tracking to monitor how much of each gap has been "filled" by subsequent price action.
How Fill Percentage Works:
For bullish gaps (gap up): Measures how far price has retraced DOWN from the gap's high toward its low
For bearish gaps (gap down): Measures how far price has retraced UP from the gap's low toward its high
The fill percentage updates in real-time as price moves through the gap zone, giving you instant feedback on gap fill progress.
Fill Detection Methods:
Wicks: Uses the full candle range (high/low) — more sensitive, detects fills earlier
Bodies: Uses only open/close prices — more conservative, requires stronger commitment
Visual Fill Indicators: The fill percentage is displayed with intuitive symbols:
〇 0-24% filled — Gap is largely untouched
◔ 25-49% filled — Minor fill in progress
◑ 50-74% filled — C.E. level has been reached
◕ 75-99% filled — Gap nearly complete
⬤ 100% filled — Gap fully filled

Hide Filled Gaps: Enable this option to automatically remove gaps from your chart once they reach 100% fill. This keeps your chart focused on active, unfilled gaps that still represent potential trading opportunities.
Projection Levels
When price breaks out of a gap zone, projection levels provide potential targets based on the gap's size.
How Projections Work: Once price closes above a gap's high (for upward projections) or below a gap's low (for downward projections), the indicator calculates extension levels using the gap's range as a measuring unit. These projections function similarly to Fibonacci extensions but are anchored to the gap's dimensions.

Projection Direction:
Upward Projections: Triggered when price closes above the gap's high — levels project above the gap
Downward Projections: Triggered when price closes below the gap's low — levels project below the gap
Customizable Multipliers: Define your own projection levels using the "Projection Levels" input. Enter comma-separated values representing multiples of the gap size:
Default: 0.5,1,2,2.5
Example custom: 0.618,1,1.618,2,2.618 (Fibonacci-based)
Each value creates a projection line at that multiple of the gap range
Projection Display Options:
Side: Display projections on the Left (extending back from gap formation) or Right (extending forward)
Color, Style, Thickness: Full visual customization
Labels: Show multiplier values at each projection level
"Extend Until Tapped" Feature: When enabled (Left side only), projection lines stop extending once price touches them. This creates a visual record of which levels have been reached and when, helping you track projection performance over time. Untapped projections continue extending until they're reached.
Labels & Formatting
Comprehensive labeling options help you quickly identify and reference gaps on your chart.
Label Format Options:
Gap Type: Simple label showing "NWOG" or "NDOG"
Gap Type + Date: Includes the full date with day of week (e.g., "NWOG Monday, November 3, 2025")
Gap Type + Date + Filled Percent: Adds the fill percentage and symbol (e.g., "NWOG Monday, November 3, 2025 [45.3% ◔]")
Label Positioning:
When Show Levels is ON: Separate labels appear at the HIGH and LOW boundaries
When Show Levels is OFF: A single label appears at the C.E. (midpoint) level
Label Customization:
Text size: Tiny, Small, Normal, or Large
Text color and background color (set background transparency to 100 for no background)
Tooltips provide detailed information including all price levels and fill percentage
Hide Historical Labels: Enable this option to hide labels and projection text on all gaps except the most recent. Lines remain visible, but text clutter is reduced — useful when tracking many historical gaps.
Status Table
An optional summary table provides at-a-glance information about all active gaps.
Table Contents: For each active gap, the table displays:
Gap Type: NWOG or NDOG with date
HIGH: Upper boundary of the gap
LOW: Lower boundary of the gap
C.E.: Consequent Encroachment (50% level)
% Filled: Current fill percentage with visual symbol

Display Settings:
Position: 9 positions available (Top/Middle/Bottom × Left/Center/Right)
Size: Tiny, Small, or Normal text
Gap Count: Control how many NWOGs and NDOGs appear in the table (1-3 each)
Adaptive Theming: The table automatically detects your chart's background color and adjusts text colors for optimal readability on both light and dark themes.
Smart Filtering: The table only shows unfilled gaps (or gaps not hidden by the "Hide Filled" setting), keeping the display focused on actionable information.
Alert System
Stay informed of key gap events without constantly monitoring your charts.
Gap Formation Alerts: Receive an alert the moment a new gap is detected. The alert includes:
Gap direction (Bullish/Bearish)
Gap type (NWOG/NDOG)
Symbol name
Example: "Bullish NWOG formed on
SPY"
Gap Filled Alerts: Get notified when a gap reaches 100% fill. This is valuable for:
Confirming trade targets have been reached
Identifying when gaps are no longer active reference points
Example: "NWOG filled on
SPY"
Projection Level Alerts: Receive alerts when price reaches your defined projection levels. Each level only alerts once, preventing spam. Useful for:
Taking profits at projection targets
Identifying extended moves beyond the gap
Example: "NWOG 2x projection reached on
SPY"
General Settings
Gap Offset: Controls how many bars the gap lines extend to the right of the current candle (0-15 bars). A higher offset keeps labels and lines visible further into the future, while a lower offset keeps the display tighter to current price action.
Tips
NWOG Priority: NWOGs typically hold more significance than NDOGs due to their weekly timeframe. When NWOG and NDOG levels conflict, consider giving more weight to the NWOG.
Unfilled Historical Gaps: Gaps from days or weeks ago can still influence current price action. Don't ignore older unfilled gaps — they often become relevant when price returns to those zones.
Session Context: Pay attention to which session created the gap. Gaps formed during high-volume sessions (like NYSE open) may carry more significance than gaps from lower-volume periods.
Gap Size Matters: Larger gaps represent more significant imbalances and often provide stronger support/resistance. Smaller gaps may fill quickly and offer less reliable levels.
Clean Chart Option: Use "Hide Historical Labels" combined with the status table to maintain a clean chart while still having access to all gap information.
Requirements
Intraday Timeframes Only: This indicator works exclusively on intraday timeframes (minutes, hours). Gap detection requires session open/close data that is only available on intraday charts.
Sufficient Historical Data: Ensure your chart has enough historical bars loaded for accurate gap tracking, especially if using higher historical count settings.
Session-Based Markets: The indicator is optimized for markets with distinct trading sessions (stocks, futures, forex). 24/7 markets like crypto may show fewer or different gap patterns.
Disclaimer
For Educational and Informational Purposes Only
This indicator is provided as a technical analysis tool for educational and informational purposes only. It is not intended as, and should not be construed as, financial advice, investment advice, trading advice, or any other type of advice.
No Guarantees: Past performance of any trading strategy, indicator, or methodology is not indicative of future results. The identification of gaps, projections, and fill levels does not guarantee that price will behave in any predicted manner. Markets are inherently unpredictable, and no technical indicator can accurately predict future price movements.
Risk Warning: Trading financial instruments involves substantial risk of loss and is not suitable for all investors. You should carefully consider your investment objectives, level of experience, and risk appetite before trading. Never trade with money you cannot afford to lose.
Not Financial Advice: The creator of this indicator (NINE) is not a licensed financial advisor, broker, or dealer. Nothing in this indicator or its documentation should be interpreted as a recommendation to buy, sell, or hold any financial instrument.
Your Responsibility: You are solely responsible for your own trading decisions. Always conduct your own research and due diligence before making any trading or investment decisions. Consider consulting with a qualified financial professional before trading.
No Liability: The creator assumes no responsibility or liability for any errors, inaccuracies, or omissions in this indicator or its documentation. The creator shall not be held liable for any losses, damages, or costs arising from the use or inability to use this indicator.
A professional-grade indicator for detecting and visualizing New Week Opening Gaps (NWOGs) and New Day Opening Gaps (NDOGs), essential concepts in ICT (Inner Circle Trader) methodology and analysis.
What Are Opening Gaps?
Opening gaps represent price inefficiencies created between trading sessions. When one session closes and the next session opens at a different price, the resulting "gap" creates a zone of unfilled orders and potential liquidity. These gaps often act as magnets for price, providing high-probability trading opportunities as the market seeks to rebalance these inefficiencies.
NWOG (New Week Opening Gap)
The gap between Friday's close and Sunday's open. These weekly imbalances are significant because they represent the collective repositioning of institutional traders over the weekend. NWOGs frequently serve as major support/resistance zones that can influence price action for days or even weeks. Due to their larger timeframe context, NWOGs typically carry more weight than daily gaps.
NDOG (New Day Opening Gap)
The gap between one session's close and the next session's open. Daily gaps occur more frequently than weekly gaps, offering more regular trading setups. While individually less significant than NWOGs, NDOGs provide valuable intraday reference points and often fill within the same trading session.
Features In Depth
Gap Detection & Visualization
The indicator automatically identifies and plots opening gaps as they form in real-time.
Automatic Detection: The indicator monitors session transitions and instantly identifies when a gap forms between the previous close and current open. NWOGs are detected on Sunday opens, while NDOGs are detected at each new daily session open (excluding Sundays, which are reserved for NWOG detection).
Bullish vs Bearish Classification: Each gap is automatically classified based on its direction:
Bullish Gap (Gap Up): Current open is higher than previous close, indicates overnight buying pressure
Bearish Gap (Gap Down): Current open is lower than previous close, indicates overnight selling pressure
The indicator uses distinct color schemes for bullish and bearish gaps, making it easy to identify gap direction at a glance. Current/most recent gaps use the "new" color settings, while historical gaps use the standard color settings.
Historical Tracking: Track up to 20 gaps of each type simultaneously. The "Historical Count" setting controls how many gaps remain visible on your chart. Older gaps are automatically removed as new ones form, keeping your chart clean while maintaining relevant historical context.
Visual Customization:
Toggle gap boundary lines (HIGH/LOW) on or off independently from the background fill
Choose line styles: solid (⎯⎯⎯), dashed (----), or dotted (····)
Adjust line thickness from 1-4 pixels
Enable/disable background fill with customizable transparency
Set colors independently for current vs historical gaps
Consequent Encroachment (C.E.)
The Consequent Encroachment represents the 50% midpoint of a gap — a critical level in ICT methodology.
Why C.E. Matters: In smart money concepts, the C.E. level represents the point of maximum efficiency within an imbalance. Price often gravitates toward this level as it seeks to rebalance the gap. Many traders use C.E. as their primary target when trading gap fills, or as a key level for entries and stop placement.
C.E. Display Options:
Independent color settings for current vs historical gaps
Separate line style and thickness controls
Can be shown/hidden independently from gap boundaries
Quarter Levels (25% and 75%): For traders who want additional precision, the indicator offers optional quarter levels at 25% and 75% of the gap range. These levels can serve as:
Partial profit targets
Scaling entry points
Additional support/resistance zones within the gap
Fill Tracking & Percentage
The indicator provides sophisticated fill tracking to monitor how much of each gap has been "filled" by subsequent price action.
How Fill Percentage Works:
For bullish gaps (gap up): Measures how far price has retraced DOWN from the gap's high toward its low
For bearish gaps (gap down): Measures how far price has retraced UP from the gap's low toward its high
The fill percentage updates in real-time as price moves through the gap zone, giving you instant feedback on gap fill progress.
Fill Detection Methods:
Wicks: Uses the full candle range (high/low) — more sensitive, detects fills earlier
Bodies: Uses only open/close prices — more conservative, requires stronger commitment
Visual Fill Indicators: The fill percentage is displayed with intuitive symbols:
〇 0-24% filled — Gap is largely untouched
◔ 25-49% filled — Minor fill in progress
◑ 50-74% filled — C.E. level has been reached
◕ 75-99% filled — Gap nearly complete
⬤ 100% filled — Gap fully filled
Hide Filled Gaps: Enable this option to automatically remove gaps from your chart once they reach 100% fill. This keeps your chart focused on active, unfilled gaps that still represent potential trading opportunities.
Projection Levels
When price breaks out of a gap zone, projection levels provide potential targets based on the gap's size.
How Projections Work: Once price closes above a gap's high (for upward projections) or below a gap's low (for downward projections), the indicator calculates extension levels using the gap's range as a measuring unit. These projections function similarly to Fibonacci extensions but are anchored to the gap's dimensions.
Projection Direction:
Upward Projections: Triggered when price closes above the gap's high — levels project above the gap
Downward Projections: Triggered when price closes below the gap's low — levels project below the gap
Customizable Multipliers: Define your own projection levels using the "Projection Levels" input. Enter comma-separated values representing multiples of the gap size:
Default: 0.5,1,2,2.5
Example custom: 0.618,1,1.618,2,2.618 (Fibonacci-based)
Each value creates a projection line at that multiple of the gap range
Projection Display Options:
Side: Display projections on the Left (extending back from gap formation) or Right (extending forward)
Color, Style, Thickness: Full visual customization
Labels: Show multiplier values at each projection level
"Extend Until Tapped" Feature: When enabled (Left side only), projection lines stop extending once price touches them. This creates a visual record of which levels have been reached and when, helping you track projection performance over time. Untapped projections continue extending until they're reached.
Labels & Formatting
Comprehensive labeling options help you quickly identify and reference gaps on your chart.
Label Format Options:
Gap Type: Simple label showing "NWOG" or "NDOG"
Gap Type + Date: Includes the full date with day of week (e.g., "NWOG Monday, November 3, 2025")
Gap Type + Date + Filled Percent: Adds the fill percentage and symbol (e.g., "NWOG Monday, November 3, 2025 [45.3% ◔]")
Label Positioning:
When Show Levels is ON: Separate labels appear at the HIGH and LOW boundaries
When Show Levels is OFF: A single label appears at the C.E. (midpoint) level
Label Customization:
Text size: Tiny, Small, Normal, or Large
Text color and background color (set background transparency to 100 for no background)
Tooltips provide detailed information including all price levels and fill percentage
Hide Historical Labels: Enable this option to hide labels and projection text on all gaps except the most recent. Lines remain visible, but text clutter is reduced — useful when tracking many historical gaps.
Status Table
An optional summary table provides at-a-glance information about all active gaps.
Table Contents: For each active gap, the table displays:
Gap Type: NWOG or NDOG with date
HIGH: Upper boundary of the gap
LOW: Lower boundary of the gap
C.E.: Consequent Encroachment (50% level)
% Filled: Current fill percentage with visual symbol
Display Settings:
Position: 9 positions available (Top/Middle/Bottom × Left/Center/Right)
Size: Tiny, Small, or Normal text
Gap Count: Control how many NWOGs and NDOGs appear in the table (1-3 each)
Adaptive Theming: The table automatically detects your chart's background color and adjusts text colors for optimal readability on both light and dark themes.
Smart Filtering: The table only shows unfilled gaps (or gaps not hidden by the "Hide Filled" setting), keeping the display focused on actionable information.
Alert System
Stay informed of key gap events without constantly monitoring your charts.
Gap Formation Alerts: Receive an alert the moment a new gap is detected. The alert includes:
Gap direction (Bullish/Bearish)
Gap type (NWOG/NDOG)
Symbol name
Example: "Bullish NWOG formed on
Gap Filled Alerts: Get notified when a gap reaches 100% fill. This is valuable for:
Confirming trade targets have been reached
Identifying when gaps are no longer active reference points
Example: "NWOG filled on
Projection Level Alerts: Receive alerts when price reaches your defined projection levels. Each level only alerts once, preventing spam. Useful for:
Taking profits at projection targets
Identifying extended moves beyond the gap
Example: "NWOG 2x projection reached on
General Settings
Gap Offset: Controls how many bars the gap lines extend to the right of the current candle (0-15 bars). A higher offset keeps labels and lines visible further into the future, while a lower offset keeps the display tighter to current price action.
Tips
NWOG Priority: NWOGs typically hold more significance than NDOGs due to their weekly timeframe. When NWOG and NDOG levels conflict, consider giving more weight to the NWOG.
Unfilled Historical Gaps: Gaps from days or weeks ago can still influence current price action. Don't ignore older unfilled gaps — they often become relevant when price returns to those zones.
Session Context: Pay attention to which session created the gap. Gaps formed during high-volume sessions (like NYSE open) may carry more significance than gaps from lower-volume periods.
Gap Size Matters: Larger gaps represent more significant imbalances and often provide stronger support/resistance. Smaller gaps may fill quickly and offer less reliable levels.
Clean Chart Option: Use "Hide Historical Labels" combined with the status table to maintain a clean chart while still having access to all gap information.
Requirements
Intraday Timeframes Only: This indicator works exclusively on intraday timeframes (minutes, hours). Gap detection requires session open/close data that is only available on intraday charts.
Sufficient Historical Data: Ensure your chart has enough historical bars loaded for accurate gap tracking, especially if using higher historical count settings.
Session-Based Markets: The indicator is optimized for markets with distinct trading sessions (stocks, futures, forex). 24/7 markets like crypto may show fewer or different gap patterns.
Disclaimer
For Educational and Informational Purposes Only
This indicator is provided as a technical analysis tool for educational and informational purposes only. It is not intended as, and should not be construed as, financial advice, investment advice, trading advice, or any other type of advice.
No Guarantees: Past performance of any trading strategy, indicator, or methodology is not indicative of future results. The identification of gaps, projections, and fill levels does not guarantee that price will behave in any predicted manner. Markets are inherently unpredictable, and no technical indicator can accurately predict future price movements.
Risk Warning: Trading financial instruments involves substantial risk of loss and is not suitable for all investors. You should carefully consider your investment objectives, level of experience, and risk appetite before trading. Never trade with money you cannot afford to lose.
Not Financial Advice: The creator of this indicator (NINE) is not a licensed financial advisor, broker, or dealer. Nothing in this indicator or its documentation should be interpreted as a recommendation to buy, sell, or hold any financial instrument.
Your Responsibility: You are solely responsible for your own trading decisions. Always conduct your own research and due diligence before making any trading or investment decisions. Consider consulting with a qualified financial professional before trading.
No Liability: The creator assumes no responsibility or liability for any errors, inaccuracies, or omissions in this indicator or its documentation. The creator shall not be held liable for any losses, damages, or costs arising from the use or inability to use this indicator.
Script protegido
Este script se publica como código cerrado. No obstante, puede utilizarlo libremente y sin ninguna limitación. Obtenga más información aquí.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script protegido
Este script se publica como código cerrado. No obstante, puede utilizarlo libremente y sin ninguna limitación. Obtenga más información aquí.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.