OPEN-SOURCE SCRIPT

Market Open Marker - NQ

37
//version=5
indicator("Market Open Marker - NQ", overlay=true)

// Define market open time (New York Time)
nyHour = 8
nyMinute = 0
nyTimezone = "America/New_York"

// Get today's timestamp for 8:00 AM in New York time
nySession = timestamp(nyTimezone, year(time), month(time), dayofmonth(time), nyHour, nyMinute)

// Check if the current bar time matches 8 AM NY time
showMarker = (time >= nySession and time < nySession + 60 * 1000) // Within 1 minute of 8 AM

// Plot vertical line at 8 AM New York Time
if showMarker
line.new(x1=bar_index, y1=high, x2=bar_index, y2=low, width=2, color=color.blue, style=line.style_dashed)

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.