OPEN-SOURCE SCRIPT

Midnight Open

625
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.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。