mohit sah
mohit sah

Reputation: 3

Draw Vertical lines on particular date in tradingview

I am trying to plot vertical lines on particular dates. Tried this script below :

//@version=3
study("Vertical lines", overlay=true, scale=scale.none)

plot((time == timestamp(2021,03,05,0,0)) ? 10e20 : na, 
      color = red, linewidth = 10, title = "27", style = histogram)

plot((time == timestamp(2021,03,01,0,0)) ? 10e20 : na, 
      color = green, linewidth = 10, title = "28", style = histogram)

This did not get the desired result. The indicator got plotted but did not see any vertical lines being plotted.

Would appreciate any help and thoughts.

Thanks

Upvotes: 0

Views: 2669

Answers (1)

AnyDozer
AnyDozer

Reputation: 2568

Your script works without any errors. Vertical lines are displayed, but only for symbols that are traded 24 hours a day. Change the time so that it falls within the trading session of your symbol.

enter image description here

Upvotes: 2

Related Questions