OPEN-SOURCE SCRIPT
NDOG NWOG by Laofengtrading

This indicator automatically marks New Daily Opening Gaps (NDOG) and New Weekly Opening Gaps (NWOG) using New York time.
NDOG is calculated from the previous New York 16:59 close to the 18:00 open. The gap is labeled with the next trading day date, because the 18:00 open belongs to the next trading session.
NWOG is detected when the gap is formed from Friday 16:59 close to Sunday 18:00 open.
Features:
- Automatically detects NDOG and NWOG
- Uses fixed New York time
- Calculates gaps from 1-minute data
- Draws each gap as a rectangle from the gap creation point to the latest candle
- Displays the gap name and trading date next to the rectangle
- Optional middle line
- Customizable NDOG and NWOG background colors
- Separate colors for the latest NDOG and latest NWOG
- Customizable text color and size
- Adjustable retention count for NDOG and NWOG
Default retention:
NDOG: 5
NWOG: 3
NDOG is calculated from the previous New York 16:59 close to the 18:00 open. The gap is labeled with the next trading day date, because the 18:00 open belongs to the next trading session.
NWOG is detected when the gap is formed from Friday 16:59 close to Sunday 18:00 open.
Features:
- Automatically detects NDOG and NWOG
- Uses fixed New York time
- Calculates gaps from 1-minute data
- Draws each gap as a rectangle from the gap creation point to the latest candle
- Displays the gap name and trading date next to the rectangle
- Optional middle line
- Customizable NDOG and NWOG background colors
- Separate colors for the latest NDOG and latest NWOG
- Customizable text color and size
- Adjustable retention count for NDOG and NWOG
Default retention:
NDOG: 5
NWOG: 3
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.