OPEN-SOURCE SCRIPT

10am/10pm opens

226
Dual Time Opens (10:00 / 22:00) — 2H

This indicator marks the opening price of two specific times of day and draws each as a horizontal line that stops after a set duration. By default it plots the 10:00 AM and 10:00 PM New York opens, with each line running exactly two hours forward.

WHY TIME-LIMITED LINES

Most opening-price scripts extend their levels to the right edge of the chart or to the end of the session. That works when you only care about one level, but it clutters quickly once you're tracking multiple times per day, and it visually implies the level still matters hours after it stopped being relevant. This script draws each line for a defined window and then ends it, so what you see on the chart is the period the level was actually in play.

HOW IT WORKS

On each trading day the script identifies the first bar that reaches the configured time and records that bar's open price. It then draws a horizontal line from that bar forward by the chosen duration, measured in clock time rather than in bar counts — so the line covers the same real-world window regardless of whether you're on a 1-minute or 15-minute chart. If the exact bar is missing due to a data gap or thin liquidity, the script falls back to the first available bar within the window rather than skipping the day.

Times are evaluated in a user-selected timezone, independent of the chart's own timezone setting. The default is America/New_York, so 10:00 and 22:00 mean 10am and 10pm Eastern no matter how your chart is configured.

SETTINGS

Clock to use — timezone the times are measured in, or "Exchange" for the symbol's native time
Open #1 / Open #2 — hour and minute for each level, plus color and label tag; either can be turned off
Extend for (hours) — line duration, adjustable from 15 minutes to 24 hours
Width / Style — solid, dashed or dotted
Price tag — optional label showing the level's price at the end of each line
Keep last N days — trims older drawings to stay under Pine's 500-object limit

Alerts are available for each level being marked.

NOTES

Requires an intraday timeframe of 1 hour or lower. On symbols with restricted sessions, a level only appears if the chart's session actually covers that time — for a 22:00 level on equities, extended hours must be enabled.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.