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

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明