OPEN-SOURCE SCRIPT
Midnight Open

This Midnight open indicator tracks and displays each trading day’s midnight open based on a user-selected time zone. It lets the user choose between America/New_York, the chart’s exchange time zone, UTC, GMT, or a custom GMT/UTC hour offset, then detects when midnight occurs in that time zone and captures the open price either from the chart timeframe or from a 1-minute source for better precision. It filters by trading-week mode, so the script can operate on standard Monday–Friday schedules, Sunday–Thursday futures-style weeks, or all calendar days. Once a valid midnight open is found, it plots the current day’s level as a step line on the chart and can also draw a separate horizontal line for each day, with optional labels showing the weekday, 00:00 time stamp, and active time zone.
The Midnight Open indicator also keeps a rolling weekday dashboard that stores the latest Monday through Friday midnight open values and shows them in a table in the chart corner, with the active time zone included in the table header. Those table values are formatted with comma-separated numbers while preserving the instrument’s tick precision. To keep the chart clean, the script automatically limits how many historical lines and labels remain visible based on a user-defined lookback count. In addition, it generates a “new midnight open” event when a fresh daily level is captured and can fire a dynamic alert message that includes the active time zone, symbol, and timeframe, making it easier to monitor midnight reference levels across different markets and time zone settings.
The Midnight Open indicator also keeps a rolling weekday dashboard that stores the latest Monday through Friday midnight open values and shows them in a table in the chart corner, with the active time zone included in the table header. Those table values are formatted with comma-separated numbers while preserving the instrument’s tick precision. To keep the chart clean, the script automatically limits how many historical lines and labels remain visible based on a user-defined lookback count. In addition, it generates a “new midnight open” event when a fresh daily level is captured and can fire a dynamic alert message that includes the active time zone, symbol, and timeframe, making it easier to monitor midnight reference levels across different markets and time zone settings.
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.