//version=5 indicator("EU Stock Market Time Zone with Vertical Lines", overlay=true)
// Define the start and end times of the EU stock market euMarketOpen = timestamp("GMT+1", year, month, dayofmonth, 09, 00) // 9:00 AM CET euMarketClose = timestamp("GMT+1", year, month, dayofmonth, 17, 30) // 5:30 PM CET
// Check if the current time is within the EU market hours isEUmarketOpen = (time >= euMarketOpen and time <= euMarketClose)
// Draw vertical dotted lines during the EU market hours var lineColor = color.new(color.blue, 0) if (isEUmarketOpen and na(time[1])) line.new(x1=na, y1=na, x2=na, y2=na, xloc=xloc.bar_time, extend=extend.both, color=lineColor, style=line.style_dotted, width=1)
// Plot a horizontal line to mark EU market hours plot(isEUmarketOpen ? close : na, style=plot.style_linebr, color=color.blue, linewidth=2, title="EU Market Hours")