Это адаптация кода midtownsk8rguy здесь :
//@version=4
study("Periodic Vline", overlay=true)
p = timeframe.ismonthly ? "12M" : "M"
vline(BarIndex, Color, LineStyle, LineWidth) =>
return = line.new(BarIndex, low - tr, BarIndex, high + tr, xloc.bar_index, extend.both, Color, LineStyle, LineWidth)
if change(time(p))
vline(bar_index, #FF800080, line.style_dashed, 1)