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 อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน