# Scan for Dead Cat Bounce in ThinkorSwim

#### lucius

##### New member
Is it possible to create a scan for dead cat bounces or how some traders call it as the "h pattern"?

This is an example of a Futures contract /HG on 1/11/2021 between the hours of 6PM EST and 9PM EST - Please know this works on regular stocks as well.
The Yellow line is the VWAP.

Here is another example

This is how the Dead Cat bounce is defined: https://www.investopedia.com/terms/d/deadcatbounce.asp

I've been dabbling with some code but have not had much success.

Code:
declare lower;
input length = 5;

def IsLongBlack = IsLongBlack(length);

def myVWAP = reference VWAP()."VWAP";
def underVWAP = high < myVWAP;

def redCandles = sum(close < open, 2) >=2;
def lowerLows = sum(high < high[1] && low < low[1] ,2) >= 2;

plot scan = underVWAP and (redCandles or redCandles[1]) and
(lowerLows or lowerLows[1]) and IsLongBlack;

Here I am defining what may be what's marked as B in the image above. What I am having difficulty coding is the condition between B and C.

There may be a better way of accomplishing this. Any help will be greatly appreciated.

if condition is higher than C and lower and B then true else false
Code:
def istrue = if ((condition > C) and (condition < B)) then 1 else 0;

@XeoNoX Thank you, I will give this a shot.

Whoops, @luicius here is corrected, I forgot to cover the other possibility:

#if condition is higher than C and condition is lower than B OR condition is lower than C and condition is higher than B then true else false

Code:
#Code:
def istrue = if ((condition > C) and (condition < B)) or  ((condition <  C) and (condition > B)) then 1 else 0;

This question might look weird but would like to know which stocks are moving faster than other.
Lets say for day trade most of the time when SPY swings like 100 points and once it reaches some confluence point there is chance of bounce.
After confirmation if we need to play the stocks which are bouncing harder can be great rewarding. So there should be some way to find the stock which moving faster than other or lets say bouncing more.

Sometimes it happens stock sold-out more lets say 10% and retraced back 8% and few stocks down 2% and retraced only 1%. So playing the stocks which have a greater momentum when market bouncing can be greatly rewarding.
This forum has so many great indicators and many people use it . If anything can come close to find these would be great. Love to hear your thoughts.

This question might look weird but would like to know which stocks are moving faster than other.
Lets say for day trade most of the time when SPY swings like 100 points and once it reaches some confluence point there is chance of bounce.
After confirmation if we need to play the stocks which are bouncing harder can be great rewarding. So there should be some way to find the stock which moving faster than other or lets say bouncing more.

Sometimes it happens stock sold-out more lets say 10% and retraced back 8% and few stocks down 2% and retraced only 1%. So playing the stocks which have a greater momentum when market bouncing can be greatly rewarding.
This forum has so many great indicators and many people use it . If anything can come close to find these would be great. Love to hear your thoughts.
Spent some time to think about the solution and here is what I came up with.. If we can develop a watchlist column with percentage change and stock price input should be based on time. Lets say choose a base price for the stock based on time. For e.g. at 11am if \$AAPL price is 121 then from that time what is the percentage change. If SPY is bouncing at 11am then based on base price you can see which stock bouncing faster. @BenTen @wtf_dude your thoughts about solution or a direction ? Is this feasible to develop this logic ? p.s : There is no holy grail setup but still we need to find the setup for good stock entry

Whoops, @luicius here is corrected, I forgot to cover the other possibility:

#if condition is higher than C and condition is lower than B OR condition is lower than C and condition is higher than B then true else false

Code:
#Code:
def istrue = if ((condition > C) and (condition < B)) or  ((condition <  C) and (condition > B)) then 1 else 0;
Can we have full code updated one?

Can we have full code updated one?
This was a partial discussion of overall logic. There was no complete answer to the question to be found. There is no full code update.

Last edited:
Thread starter Similar threads Forum Replies Date
God Mode + RSI Scan? Questions 1
Range Difference Scan Questions 2
20 EMA break retrace scan Questions 6
Help with FTD Scan - Follow Through Day. Questions 1
scan tickers == 200MA Questions 1

### Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
197 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• 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?