@givemefood You should set up two separate scanners. One for "crosses below" and the other one for "crosses above"
#Plot yesterday's mid range def Yhigh = high(period = "day" ); def Ylow = low(period = "day" ); plot mid = (Yhigh + Ylow) / 2;
@BenTen@wst459 Maybe something like this should work https://usethinkscript.com/threads/opening-range-orb-watchlist-column-for-thinkorswim.140/
You may have to modify the code a bit if you wanted something more specific.
I can't see the bottom portion of this post to see how you are suggesting to setup the scanner - can you repost that?@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:
AssignPriceColor(if close >= Yhigh then Color.GREEN else if close <= Ylow then Color.RED else Color.CURRENT); AssignPriceColor(if close > Yhigh and open < close then Color.White else if close > YHIGH and open > close then Color.Gray else if close < Ylow and open < close then Color.White else if close < Ylow and open > close then Color.Gray else Color.CURRENT);
|Thread starter||Similar threads||Forum||Replies||Date|
|J||Prior high and low & 50% of the previous candle as labels?||Questions||4|
|C||Trying to get Previous day high / low to work on Range chart||Questions||0|
|2||Scan for Lower High / Higher Low from Previous Bar and Less than 60% of previous||Questions||6|
|S||Script for high close & previous %||Questions||0|
|W||Scan for stocks above previous Week High and previous DAY High||Questions||1|