Hello, I am trying to get a horizontal line that extends to the left and right of the chart at all bars. I cant get the line to stay straight and cant get the line to plot on the previous candle. Can someone help with this?
Code:
# Horizontal line 5 cents below the previous candle's high
input offset = 0.05; # Amount below previous high (default 5 cents)
def prevHigh = high[1];
def lineLevel = prevHigh - offset;
plot LineBelowPrevHigh = lineLevel;
LineBelowPrevHigh.SetDefaultColor(Color.CYAN);
LineBelowPrevHigh.SetStyle(Curve.SHORT_DASH);
LineBelowPrevHigh.SetLineWeight(2);