RyanHunter100
New member
I'm missing a fundamental element here I'm sure, so please forgive my ignorance.
I want to see the high and low range for the last 30 minutes of yesterday.
I've got a 2 day 1 minute chart so it includes yesterday's data.
My script works as it puts a single line with the correct values on the last bar of yesterday.
My problem is I can't get the line to extend all the way to the right side of the chart.
It plots on the single bar but no further.
I want to see the high and low range for the last 30 minutes of yesterday.
I've got a 2 day 1 minute chart so it includes yesterday's data.
My script works as it puts a single line with the correct values on the last bar of yesterday.
My problem is I can't get the line to extend all the way to the right side of the chart.
It plots on the single bar but no further.
Code:
# Is it yesterday?
def yesterday = GetDay() != GetLastDay();
# Is the time at least 15:59pm?
def lastMinute = SecondsFromTime(1559) >= 0;
# If it's yesterday and within the last minute, then search for the lowest price in the last 30 minutes
def lowPrice = if yesterday and lastMinute then Lowest(low, 30) else Double.NaN;
# Plot the line on this bar only
plot YesterdayLast30MinsLow = lowPrice;
YesterdayLast30MinsLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
YesterdayLast30MinsLow.SetDefaultColor(Color.RED);
YesterdayLast30MinsLow.SetLineWeight(2);
# If it's yesterday and within the last minute, then search for the highest price in the last 30 bars
def highPrice = if yesterday and lastMinute then Highest(high, 30) else Double.NaN;
# Plot the line on this bar only
plot YesterdayLast30MinsHigh = highPrice;
YesterdayLast30MinsHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
YesterdayLast30MinsHigh.SetDefaultColor(Color.GREEN);
YesterdayLast30MinsHigh.SetLineWeight(2);