@divinci01 Since you just want to plot and scan for the previous day's high and low, here is the script for that (taken from post #1)
# 5 min opening range # Robert Payne #Plot opening range high / low input OpenRangeMinutes = 5; input MarketOpenTime = 0930; input ShowTodayOnly = yes; def Today = if GetDay() == GetLastDay() then 1 else 0; #Plot yesterday's high / low plot Yhigh = if ShowTodayOnly and !Today then Double.NaN else high(period = "day" ); plot Ylow = if ShowTodayOnly and !Today then Double.NaN else low(period = "day" ); Yhigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); Yhigh.SetDefaultColor(Color.UPTICK); Yhigh.SetLineWeight(2); Ylow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL); Ylow.SetDefaultColor(Color.DOWNTICK); Ylow.SetLineWeight(2);
Add it as a separate indicator and then setup your scanner to something like this:
is the aggregate for this is only on DAY??? i tried to change it to 2 min, I get an error.