I'm stuck and need some help please... I'm trying to create a indicator which draws a horizontal line from the Sunday Daily Open candle for the upcoming week. I found the code below as an example, which works for simple line, but the line is too short; it only continues for a day - I would want it to plot through to the following Sunday open (if this isn't possible it's also fine to just extend the line, and delete all previous lines.. or I was thinking a continuous step line could be best?)
The chart below shows how I want it to look, whether step line or individual lines for each week. But I wouldn't want them all to extend to the end of the chart, would be too messy.
study(title="Sunday Open", shorttitle="Sunday Open", overlay=true)
openPrice = security(tickerid, 'D', open)
isSunday() => dayofweek(time('D')) == sunday ? 1 : 0
plot(isSunday() and openPrice ? openPrice: na, title="Sunday Open", style=linebr, linewidth=2, color=orange)
