premiumseller
New member
Hello -
I want to draw two lines that mark the most recent 20 day high and low.
I found the following code that does that for the high:
My question: How can I draw the line starting at the bar with the actual high (or low) instead of drawing the line across the last 20 days?
Thanks
I want to draw two lines that mark the most recent 20 day high and low.
I found the following code that does that for the high:
Code:
def LastBar = HighestAll(if !IsNaN(close) then BarNumber() else Double.NaN);
def BarRem = LastBar - BarNumber();
def High65 = if !BarRem then Highest(high,period) else Double.NaN;
plot HighLine = if BarRem <= period then HighestAll(High65) else Double.NaN;
HighLine.SetPaintingStrategy(PaintingStrategy.DASHES);
HighLine.SetDefaultColor(Color.GREEN);
My question: How can I draw the line starting at the bar with the actual high (or low) instead of drawing the line across the last 20 days?
Thanks