New to Pinescript and Tradingview. I have this issue where I use a custom indicator script to plot previous day high and previous day low lines. The problem is I have no way to restrict it to plot only for today and not the entire chart which is very annoying to see. Please take a look to see if you can help me out. Thanks
Here is the code -->
study(title="Previous Day High and Low", shorttitle="Previous Day High and Low", overlay=true)
D_High = security(tickerid, 'D', high[1])
D_Low = security(tickerid, 'D', low[1])
D_Close = security(tickerid, 'D', close[1])
D_Open = security(tickerid, 'D', open[1])
plot(isintraday ? D_High : na, title="Daily High",style=line, color=green,linewidth=2)
plot(isintraday ? D_Low : na, title="Daily Low",style=line, color=red,linewidth=2)