I recently created a script in tradingview's pine editor.
study("bota", overlay=true)
t = time("240", session.extended) // 1440=60*24 is the number of minutes in a whole day
is_first = na(t[1]) and not na(t) or t[1] < t
apertura = na
if is_first and barstate.isnew
apertura := open
else
apertura := apertura[1]
plot((apertura)+60, color=blue, linewidth=1, transp=20)
plot((apertura)-60, color=red, linewidth=1, transp=20)
In which when executing it does the following: https://www.tradingview.com/x/TmBHSzjj/
But what I am looking for is this: https://www.tradingview.com/x/4rRH1FTf/
What I want with the script is that when a four hour candle starts (utc) draw two lines until the end of those four hours (regardless of the timing of the chart) without showing the previous candles and for the line to continue until the end, 60 USD above initial price (blue line) and USD 60 below (red line). Look in some forums, but it seems that the pine editor reloads all the candles above and modifies the script according to the loaded candles.