OPEN-SOURCE SCRIPT

NDOG - ICT

279
NDOG Override Companion

The **NDOG Override Companion** is a session-based New Day Opening Gap indicator designed to identify, track, and manage the directional implications of the most recent New York evening opening gap.

The indicator calculates the New Day Opening Gap using a fixed New York session definition:

  • * **Prior-session reference:** Close of the 16:30 New York 30-minute candle
  • * **New-session reference:** Open of the 18:00 New York 30-minute candle


The price difference between these two reference points forms the NDOG.

Directional Logic

The indicator classifies each qualifying NDOG as either a gap up or gap down and can use that structure as a temporary directional override.

**Gap Up**

When the 18:00 open is above the prior 16:30 close, the indicator classifies the NDOG as a gap up.

While this gap remains unfilled, the directional state is:

  • **Bearish Override — Short Only**
  • The bearish override remains active until price reaches the lower boundary of the NDOG and completely fills the gap.
  • **Gap Down**
  • When the 18:00 open is below the prior 16:30 close, the indicator classifies the NDOG as a gap down.
  • While this gap remains unfilled, the directional state is:
  • **Bullish Override — Long Only**
  • The bullish override remains active until price reaches the upper boundary of the NDOG and completely fills the gap.


A partial retracement into the NDOG does not remove the override. The directional state remains locked until the opposite boundary is reached and the gap is fully filled.

Once the NDOG is completely filled, the override terminates and the indicator returns to its normal HTF Bias state.

### NDOG Structure

For every qualifying New Day Opening Gap, the indicator calculates and tracks:

* Top boundary
* Midpoint
* Bottom boundary
* Gap direction
* Formation time
* Fill status
* Fill time

A configurable minimum gap size can also be applied to prevent insignificant price differences from being classified as valid NDOGs.

### Current NDOG Visualization

The active session NDOG can be displayed directly on the chart using:

* Shaded NDOG range
* Top boundary
* Bottom boundary
* Dashed midpoint
* Dynamic price labels

Visual elements can be individually enabled, disabled, and customized through the indicator settings.

The current NDOG extends forward while it remains active, allowing the trader to continuously monitor the relationship between price and the opening gap.

### Historical NDOGs

An optional historical mode allows previous New Day Opening Gaps to remain visible for contextual analysis.

Available historical lookback periods include:

* 30 days
* 60 days
* 90 days
* 180 days
* 240 days

Historical NDOGs maintain their original boundaries and midpoint.

When a historical gap becomes fully filled, its visual structure terminates at the bar where the fill occurred. Unfilled historical gaps continue extending forward.

This allows traders to distinguish unresolved opening gaps from structures that have already completed their lifecycle.

### NDOG Status Table

The indicator includes an optional real-time status table displaying the current NDOG state.

The table reports:

* Session Open
* Gap Direction
* Bias Override
* Directional Permission
* Top / Mid / Bottom prices
* Fill Status
* Normal HTF Bias status

Depending on the current gap condition, the directional permission can display:

**SHORT ONLY**

**LONG ONLY**

or

**DEFER TO HTF BIAS**

The table position, text size, colors, and visibility can be configured from the settings menu.

### Alerts

The indicator provides alert functionality for important NDOG events, including:

* New NDOG formation
* Top boundary reached
* Midpoint reached
* Bottom boundary reached
* Full gap fill
* Directional override change

Detailed dynamic alert messages can also report information such as the gap direction, reference prices, NDOG boundaries, session time, and current override state.

Individual alert categories can be enabled or disabled independently.

### Timeframe Handling

The NDOG reference prices are calculated internally from 30-minute data regardless of the chart timeframe.

This allows the indicator to maintain the same New York session reference structure while being viewed across different chart timeframes.

### Bias Override Output

For compatibility with additional analytical systems, the indicator internally represents its directional override as:

* **-1 = Bearish Override**
* **+1 = Bullish Override**
* **0 = Normal HTF Bias**

This output is hidden from the chart and is intended to support integration with broader analytical frameworks.

### Intended Use

The NDOG Override Companion is designed as a contextual and directional framework rather than a standalone entry system.

Its primary purpose is to determine whether an active New Day Opening Gap should temporarily supersede the normal higher-timeframe directional framework until that opening imbalance has been completely filled.

The indicator can therefore be used alongside higher-timeframe structure, price-delivery models, execution models, and other forms of discretionary or systematic market analysis.

### Important

This indicator is an analytical tool. It does not guarantee future market direction or profitability. Users should independently evaluate the methodology and incorporate appropriate execution and risk-management rules before using the information for trading decisions.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.