Hi Robert,
I'm using the zig zag indicator posted by @BenTen here: https://usethinkscript.com/threads/zigzag-high-low-with-supply-demand-zones-for-thinkorswim.172/
I would like to plot a line at the zig zag highs and lows and have the line extended indefinitely to the right.
I have tried two options, neither of them work:
Option 1 extends the lines, but not indefinitely. The high line extends until the next high starts, and the low line extends until the next low line starts.
Option 2 extends the lines, but it creates an extended line only the length of the original line and if the length of the extension is greater than the length of the original line, it puts in spaces between the original line and the new line.
Any suggestions on what I need to do to have the high and low lines extend indefinitely to the right?
Here is the code that I've tried (inserting it just below the Price Change between zigzags section:
@RobertPayne
I'm using the zig zag indicator posted by @BenTen here: https://usethinkscript.com/threads/zigzag-high-low-with-supply-demand-zones-for-thinkorswim.172/
I would like to plot a line at the zig zag highs and lows and have the line extended indefinitely to the right.
I have tried two options, neither of them work:
Option 1 extends the lines, but not indefinitely. The high line extends until the next high starts, and the low line extends until the next low line starts.
Option 2 extends the lines, but it creates an extended line only the length of the original line and if the length of the extension is greater than the length of the original line, it puts in spaces between the original line and the new line.
Any suggestions on what I need to do to have the high and low lines extend indefinitely to the right?
Here is the code that I've tried (inserting it just below the Price Change between zigzags section:
Code:
#Extend S&R Lines indefinitely to the right (WIP)
#Option 1
plot xxxhigh = xxhigh;
xxxhigh.setlineWeight(2);
xxxhigh.setDefaultColor(color.Red);
xxxhigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
plot xxxlow = xxlow;
xxxlow.setlineWeight(2);
xxxlow.setDefaultColor(color.DARK_GREEN);
xxxlow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#Option 2
input pp = 1;
plot xxxhigh4 = fold index = 1 to pp + 1 with p = 1 do xxhigh[200];
@RobertPayne