Pullback From High Question

Daybuck

New member
Hey guys, I need some help coding the following

Stock in a uptrend
Price hits 40 day high
price pulls back from 40 day high with 3 days of lower lows
The fourth day the closing price much trade higher than the closing price that was reached the previous day, the third day. Furthermore, the stock price must close in the upper 20th percentile of the daily trading range.

I don't know where to start coding so anybody that wants to tackle this it would be most appreciated. Thanks
 
@Daybuck I took a look at your request, personally I think your conditions are a bit restrictive. Nevertheless I took a stab at constructing a scan based on the following three conditions:

(1) Uptrend
(2) Price hits 40 day high
(3) Price pulls back from 40 day high with 3 days of lower closes

With these 3 conditions I scanned against the S&P 500 and obtained 2 results and for the NASDAQ COMP I obtained 3 results. Hence you are not going to get too many hits with these tight conditions. The moment I added the 4th condition you specified, I got no results

That said, here is the scan I came up with. Place these directly in the scanner. This should bring you closer to what you seek

Code:
# Uptrend Scan
# tomsk
# 1.9.2020

# This scans for stocks with the following conditions
#
# [1] Uptrend
# [2] Price hits 40 day high
# [3] Price pulls back from 40 day high with 3 days of lower lows

IsAscending(close,20) and high == Highest(high,40) within 3 bars and sum(close < close[1], 3) >= 3

# End Uptrend Scan
 
Last edited:
Thanks Tom for the quick response and code. I just thought it would be a good scan for strong stocks in an uptrend to get in on a small pullback. I am definitely open to any suggestions that may open it up a little and still accomplish what I am trying to do. Thanks again
 
Nothing wrong with your request, it is a good start. One of the things you might try is to vary the length, so rather than 40 day high, use 21 day high, etc. You get the general idea. All the best!
 

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
283 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