OPEN-SOURCE SCRIPT
10am/10pm opens

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.
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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。