red_man_1111
New member
wonder if you could give me a hand to fix the following code in order to work for larger timeframes than 3 minutes, like 15M, 30M, 1H, D, i cant manage it to make it work, indicator supposed to show a horizontal price line for last price:
Code:
#Plots a Horizontal Line that follows the price value selected
input price=close;
input offset=0;
input length = 300;
def sma = SimpleMovingAvg(price, 1, length);
rec line = if IsNaN(sma) then line[1] else sma[offset];
plot priceline=if isnan(sma) then line else double.nan;
priceline.setpaintingStrategy(paintingStrategy.LINE);
priceline.setlineWeight(3);
priceline.setdefaultColor(color.green);
priceline.hideBubble();
Last edited by a moderator: