OPEN-SOURCE SCRIPT

EU Stock Market Time Zone with Vertical Lines

//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")
Bands and Channels

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer