PROTECTED SOURCE SCRIPT
NWOG/NDOG by OutOfOptions

New Week Opening Gap (NWOG) and New Day Opening Gap (NDOG)
NWOG and NDOG represent price imbalances formed when markets skip over certain levels at the start of a new week or trading day. These gaps often serve as magnets for price action throughout the week or day, drawing prices back to fill them while also functioning as key support or resistance zones. They are particularly relevant in futures markets, though less so in equities.
Consequent Encroachment (CE)
The CE, which is the midpoint of an NWOG or NDOG, frequently emerges as a critical level—especially if the gap remains unbalanced. In such cases, it can exert a strong pull on price, encouraging retracement or consolidation.
Indicator Features
This indicator allows you to display any number of NWOGs and NDOGs directly on your chart, with complete customization of their visual appearance. You can assign distinct colors to the most recent gaps for easy identification. Unlike other tools, it includes a filtering option to exclude minor gaps that may lack significance. Additionally, the "Smart" mode intelligently positions price labels to ensure they remain visible and uncluttered at all times.
How Does it Work
The indicator tracks all daily closes and new day opens, capturing the two values representing the top/bottom of NDOG/NWOG. I If the day begins on a Sunday, the gap is identified as NWOG; otherwise, it is classified as NDOG. A key feature of the indicator is that it avoids duplicating NDOGs that are also NWOGs.
Next, the indicator applies the size filter setting (if set above 0) to skip minor gaps. Valid gaps are then displayed on the screen using a style configured in the indicator settings for the most recent NDOG/NWOG.
To prevent the chart from becoming cluttered, the indicator limits the number of NWOG/NDOGs shown. When a new NWOG/NDOG is added, it checks the total displayed, and if this exceeds the configured limit, the oldest NWOG/NDOG is removed. Additionally, the indicator updates the display style of the previous NWOG/NDOG to the generic (non-last) style as specified in the settings.
For labels showing NWOG/NDOG price ranges and CE, the indicator offers a "Smart" option that dynamically positions labels 10 bars from the last candle and adjusts them every 5 candles. Otherwise, labels are placed at the end of the week for NWOGs and at the end of the following day for NDOGs.
NWOG and NDOG represent price imbalances formed when markets skip over certain levels at the start of a new week or trading day. These gaps often serve as magnets for price action throughout the week or day, drawing prices back to fill them while also functioning as key support or resistance zones. They are particularly relevant in futures markets, though less so in equities.
Consequent Encroachment (CE)
The CE, which is the midpoint of an NWOG or NDOG, frequently emerges as a critical level—especially if the gap remains unbalanced. In such cases, it can exert a strong pull on price, encouraging retracement or consolidation.
Indicator Features
This indicator allows you to display any number of NWOGs and NDOGs directly on your chart, with complete customization of their visual appearance. You can assign distinct colors to the most recent gaps for easy identification. Unlike other tools, it includes a filtering option to exclude minor gaps that may lack significance. Additionally, the "Smart" mode intelligently positions price labels to ensure they remain visible and uncluttered at all times.
How Does it Work
The indicator tracks all daily closes and new day opens, capturing the two values representing the top/bottom of NDOG/NWOG. I If the day begins on a Sunday, the gap is identified as NWOG; otherwise, it is classified as NDOG. A key feature of the indicator is that it avoids duplicating NDOGs that are also NWOGs.
Next, the indicator applies the size filter setting (if set above 0) to skip minor gaps. Valid gaps are then displayed on the screen using a style configured in the indicator settings for the most recent NDOG/NWOG.
To prevent the chart from becoming cluttered, the indicator limits the number of NWOG/NDOGs shown. When a new NWOG/NDOG is added, it checks the total displayed, and if this exceeds the configured limit, the oldest NWOG/NDOG is removed. Additionally, the indicator updates the display style of the previous NWOG/NDOG to the generic (non-last) style as specified in the settings.
For labels showing NWOG/NDOG price ranges and CE, the indicator offers a "Smart" option that dynamically positions labels 10 bars from the last candle and adjusts them every 5 candles. Otherwise, labels are placed at the end of the week for NWOGs and at the end of the following day for NDOGs.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.