Upside Reversal Chart & Scan For ThinkOrSwim

Jeff1228

Member
Upside Reversal Chart & Scan For ThinkOrSwim
4XRW5dB.png

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);
Scan filter UpsideReversal is true
BhytpFc.png
 
Last edited by a moderator:
@Jeff1228 love the name. All the Jeffs I know are cool. I had a question regarding the scan. Does this work better with a specific stock price or is it better to keep it generalized? And does this scanner work during the premarket?
 
@Jeff1228 love the name. All the Jeffs I know are cool. I had a question regarding the scan. Does this work better with a specific stock price or is it better to keep it generalized? And does this scanner work during the premarket?
Thanks

From my observation, better to keep it generalized. It should work premarket but has a volume-related component, it won't return any results in premarket cuz the volume is usually thin.
 
@Jeff1228

Hi Jeff. Thank you for this study and scanner. Saw this when you first tried fixing the scan bug with one of our moderators and I have been using it since then specially the scanner part. Made a ton of trades based off it already. Again, thank you very much.

I just want to ask you though if you (or somebody else who can) can post here the opposite of this study- Downside Reversal pattern. It somehow feels it's a good scan and study at one week aggregation. I know it should work, but this simpleton mind of mine was not capable enough to modify the coding. I tried many times already whenever I get the chance but failed.

Thanks in advanced.
 
@Jeff1228

Hi Jeff. Thank you for this study and scanner. Saw this when you first tried fixing the scan bug with one of our moderators and I have been using it since then specially the scanner part. Made a ton of trades based off it already. Again, thank you very much.

I just want to ask you though if you (or somebody else who can) can post here the opposite of this study- Downside Reversal pattern. It somehow feels it's a good scan and study at one week aggregation. I know it should work, but this simpleton mind of mine was not capable enough to modify the coding. I tried many times already whenever I get the chance but failed.

Thanks in advanced.
Hi NeoCon, good to know you like this scanner.

I can work on the downside one, before I do that, could you please share some insights of your success using the upside one since you have done tons of trades. Also, for the downside one, do you have any specific market/names in your mind?

Thanks
 
Upside Reversal Chart & Scan For ThinkOrSwim
4XRW5dB.png

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);
Scan filter UpsideReversal is true
BhytpFc.png
Can you please help to provide the DRS_calc and DRS?
 
Last edited:
Hi NeoCon, good to know you like this scanner.

I can work on the downside one, before I do that, could you please share some insights of your success using the upside one since you have done tons of trades. Also, for the downside one, do you have any specific market/names in your mind?

Thanks
I'll give you a better one: An explanation from someone who mentored me years ago + it's accompanying study and also recent entries I did on a ticker. Trade still ongoing.


Accompanying study:

https://usethinkscript.com/threads/eci-gaussian-indicator-for-thinkorswim.1160/

As for your last question, I try to avoid giving specifics per usual courtesy. Recent shorting we did thoughy are energy stocks specially ETFs. But not anymore as they are mostly consolidating.

[EDIT]
Sorry I had to repost the image properly per forum guidelines. Apologies to our great mod here.

s1VaI8W.png


The studies on this image are the following.
1. The aforementioned upside study and scan.
2. https://usethinkscript.com/threads/eci-gaussian-indicator-for-thinkorswim.1160/ - ECI Gaussian study
3. https://usethinkscript.com/threads/moving-average-crossovers-for-thinkorswim.229/ - Movinga average crossover using 8ema and 21ema.

The rest are our usual long term moving averages: 65ema (yellow) and 200sma (purple). The rest are just manual notations of the trade. Ticker is DQ. This is for the long side.

Apologies, mods.
 
Last edited:
I used the scanner and the indicator today for DLO. I closed out my position up 70%. Love to see this expanded upon to include a downside aswell.
 
Thank you all for your kind replies.

As the author, I'm beyond happy that this indicator/scanner helped many people. However, one or a few successful trades don't make it a successful strategy. I used it, and harvested on $ZIM, $NET, $ASAN, but I also had many failures. So my question for you is, has anyone done a serious study on it? What's the CAGR and Sharpe/Sortino ratios look like? Or what are other takeaways from using it? Please share.

Plus, I am a firm believer that retail traders can be successful only if they trade along with the big whales. It's the institutional buying or selling that drives the price. So if someone can share some insights on institutional behaviors, maybe we can come up with better indicators to identify those opportunities for greater success.


Thank you all
 
Last edited:
Upside Reversal Chart & Scan For ThinkOrSwim
4XRW5dB.png

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);
Scan filter UpsideReversal is true
BhytpFc.png
Thanks for the scan. I will give it a try tomorrow.
 
Last edited:
Thank you all for your kind replies.

As the author, I'm beyond happy that this indicator/scanner helped many people. However, one or a few successful trades don't make it a successful strategy. I used it, and harvested on $ZIM, $NET, $ASAN, but I also had many failures. So my question for you is, has anyone done a serious study on it? What's the CAGR and Sharpe/Sortino ratios look like? Or what are other takeaways from using it? Please share.

Plus, I am a firm believer that retail traders can be successful only if they trade along with the big whales. It's the institutional buying or selling that drives the price. So if someone can share some insights on institutional behaviors, maybe we can come up with better indicators to identify those opportunities for greater success.


Thank you all
You actually made me chuckle/ smile a bit cause it made me remember the futures and forex guys of the company I used to worked with (six years as equities trader for some investment fund) cause those terms (and some more) is what we hear whenever their floors do their wednesday meetings. Our risk manager on the other hand hammered us in only two things: risk reward multiples and positioning sizing. I think it was Stan Weinstein who said trading/TA is more of an art than a science. Anyway, I digress.

The Upside reversion tick pattern (URS), in and by itself, is nothing special. I see it almost everyday. What makes it particularly unique is in a HIGHLY trending environment, it shows a possible good entry and more importantly it gives a risk definition, a quite rare feature to a single tick. Why? It's perhaps best explained by IBD and some good youtuber.

IBD: Upside Reversals Reveal Big Clues

The Upside Reversal Stock Setup

I should also better explain my ongoing trade on $DQ as shown in the image above, particularly the entries. My initial position was entered pretty early (forming wall of a shallow cup). I was not sure back then if it's just a random versus accumulative move by the ticker, but seeing some chinese and solar stocks were moving, hence I made pilot position. The ticker moved up substantially, consolidate a bit but went down significantly which was not a good pattern for me. However, when seeing that a URS started to form, my trading conviction just went up significantly and made the position a full size. It even gave me a very early entry point intraday as it was clear on price-volume action, it will end up as URS. The risk is defined by what both videos explain + I have a cushion via the pilot entry.

So per my use your tick coding and scan doesn't need any serious study to validate its use. It doesn't need one. Where it really shines is when a technician trader looks unto hundreds of charts every single day. The bubble just really makes it easy to catch in a quick look and the scan makes a trigger on my substantially sized watchlist + positions (albeit delayed due to TOS's one scan/ 5 minute limit.)

And if I may, I'm posting below a version 2 of your coding (and also the Dowside version) which was based on my feeble attempt on coding the IBD definition. I'm not sure if it was properly done right, but it definitely adds more triggers. I did not post them here at the outset as I know the coding is poor but they've been working for my purpose in a way.

Code:
# Upside reversion pattern per IBD

declare upper;

## input range1 = 10;
## input range2 = 30;

def EMA65 = MovAvgExponential(close, 65);
def EMA8 = MovAvgExponential(close, 8);
def EMA21 = MovAvgExponential(close, 21);
def Vol5 = SimpleMovingAvg(volume, 5);


def pct = Round((close - close[1]) / close[1] * 100, 1);

# def lo = lowest(low,range1);
## def lo = lowest(low);

#def hi = highest(high,range2);
## def hi = highest(high);

## def URS_calc = close >= hi * 0.75
def URS_calc = close >= high * 0.60
## and lo <= hi * 0.95
## and high < hi * 0.98
and close > close[1]
and close > open

#and volume > Vol10[1]
## (orig) and ((volume > Vol10[1] and volume > volume[1] * 0.8) or (volume > volume[1] * 1.5))
# (my mod)
and ((volume > Vol5[1]) or (volume > volume[1]))
and (EMA21 > EMA65 or EMA8 >  EMA65)
and close >  EMA65
and  EMA65 > EMA65[1]
#and (low == lo or low[1] == lo)
and (low < low[1])
and (low < EMA8 or low < EMA21 or low < EMA65)
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 - (low * 0.02), “URS2: " + pct + “ %" , Color.PINK, no);

# https://usethinkscript.com/threads/upside-reversal-scanner-is-not-working.8640/#post-80250


The Downside reversion pattern per IBD

Code:
# Downside reversion pattern per IBD; beta version

declare upper;

## input range1 = 10;
## input range2 = 30;

def EMA65 = MovAvgExponential(close, 65);
def EMA8 = MovAvgExponential(close, 8);
def EMA21 = MovAvgExponential(close, 21);
def Vol5 = SimpleMovingAvg(volume, 5);


def pct = Round((close - close[1]) / close[1] * 100, 1);

# def lo = lowest(low,range1);
## def lo = lowest(low);

#def hi = highest(high,range2);
## def hi = highest(high);

## def URS_calc = close >= hi * 0.75
def PRS_calc = close >= high * 0.40
## and lo <= hi * 0.95
## and high < hi * 0.98
and close < close[1]
and close < open

#and volume > Vol10[1]
## (orig) and ((volume > Vol10[1] and volume > volume[1] * 0.8) or (volume > volume[1] * 1.5))
# (my mod)
and ((volume > Vol5[1]) or (volume > volume[1]))
and (EMA21 > EMA65 or EMA8 >  EMA65)
and close >  EMA65
and  EMA65 > EMA65[1]
#and (low == lo or low[1] == lo)
and (low > low[1])
and (low > EMA8 or low > EMA21 or low > EMA65)
and (close[2] > close [1] or close[3] > close[2])
#and URS[1] is false
;

def PRS =  PRS_calc > 0;
plot DownsideReversal = PRS and !PRS[1];
#UpsideReversal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_down);
#UpsideReversal.SetDefaultColor(GetColor(3));
#UpsideReversal.SetLineWeight(1);
DownsideReversal.Hide();

AddChartBubble (DownsideReversal, High + (high * 0.05), “PRS2: " + pct + “ %" , Color.PINK, no);

# https://usethinkscript.com/threads/upside-reversal-scanner-is-not-working.8640/#post-80250
 
Last edited:

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
481 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top