godzilla74
New member
I'm trying to create a simple script that looks at the previous candle (regardless of timeframe) and plots a line at 50% of that previous candle in the current candles vertical space. Being new to Thinkscript, I've read through the tutorials, but just accomplishing this one thing is alluding me.
I have the 50% happening, however there are a few issues that I can't seem to figure out:
1. There is a plot to the right of the current/latest candle (in this case the rightmost green one), I don't want/need that plot or the other plotted lines that I've marked out.
2. I'd like the actual plotted line "The only one that isn't marked out in the screenshot, to extend all the way to the left of the chart instead of just the bar width. Is that possible? I don't see a 'line length' type of attribute I can set.
Here is the code:
Thanks!
Justin
I have the 50% happening, however there are a few issues that I can't seem to figure out:
1. There is a plot to the right of the current/latest candle (in this case the rightmost green one), I don't want/need that plot or the other plotted lines that I've marked out.
2. I'd like the actual plotted line "The only one that isn't marked out in the screenshot, to extend all the way to the left of the chart instead of just the bar width. Is that possible? I don't see a 'line length' type of attribute I can set.
Here is the code:
Code:
input AggregationPeriod = AggregationPeriod.DAY;
plot midrange = hl2(period = AggregationPeriod)[1];
midrange.SetDefaultColor(Color.RED);
midrange.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
midrange.SetLineWeight(2);
Thanks!
Justin