Upside Reversal Chart & Scan For ThinkOrSwim
Scan filter UpsideReversal is true
Ruby:
declare upper;
input range1 = 10;
input range2 = 30;
def SMA50 = SimpleMovingAvg(close, 50);
def EMA10 = MovAvgExponential(close, 10);
def EMA20 = MovAvgExponential(close, 20);
def Vol10 = SimpleMovingAvg(volume,10);
def pct = round((close - close[1]) / close[1] * 100, 2);
def lo = lowest(low,range1);
def hi = highest(high,range2);
def URS_calc = close >= hi * 0.75
and lo <= hi * 0.95
and high < hi * 0.98
and close > close[1]
and close > open
#and volume > Vol10[1]
and ((volume > Vol10[1] and volume > volume[1] * 0.8) or (volume > volume[1] * 1.5))
and (EMA20 > SMA50 or EMA10 > SMA50)
and close > SMA50
and SMA50 > SMA50[1]
#and (low == lo or low[1] == lo)
and (low == lo or low[1] == lo or low[2] ==lo)
and (close[2] > close [1] or close[3] > close[2])
#and URS[1] is false
;
def URS = URS_calc >0;
plot UpsideReversal = URS and !URS[1];
#UpsideReversal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down);
#UpsideReversal.SetDefaultColor(GetColor(3));
#UpsideReversal.SetLineWeight(1);
UpsideReversal.hide();
AddChartBubble(UpsideReversal, low, “URS, Pct=" + pct, Color.PINK, no);
Last edited by a moderator: