I'm looking for an indicator that draws a horizontal line all the way across the screen at the current price level (and obviously adjusts with price). I think this comes standard on tradingview but doesn't on TOS for some reason. I got this script from someone else and it works fine, however, the problem is that you have to adjust the length, so on some time frames it's very short and on others it's very long. Does anyone have a script that would show a horizontal price line extending throughout the entire chart no matter what time frame is used? Here is the code I started with for reference:
#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();
#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();