There was no "full code". This thread is just a discussion of best coding practices for PLOT statements.
Understood. I wish PC version was like Android where there is a line on the chart that shows you where the current price is on the latest candle. But I edited the code a bit and added that very last part to it, at least those lines kinda get the job done, not very clean however it leaves a trail of lines from previous candles:
# plots a bubble x bars after last bar
input bars_in_future = 3;
def bif = bars_in_future;
def cls = close;
def x = isNaN(cls[bif]) and !isNaN(cls[bif+1]);
def vert = cls[bif+1];
def z = cls[bif+1];
#AddChartBubble(x, vert, vert, color.white, yes);
#addchartBubble(isnan(close[-1]), text = close, "price location" = HIGH, color = Color.ORANGE);
#addchartBubble(!isnan(close[0]) and isnan(close[-1]), high, close, Color.ORANGE, yes);
plot currentpricelevel = z;
#--------------------------------------------------------------
currentpricelevel.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
currentpricelevel.SetDefaultColor(Color.white);