MA Cross After Low For ThinkOrSwim

number9

New member
Good morning. I'm looking for a scan script (daily) that will show me securities where the 2-period SMA crosses above the 9-period SMA after the 52-week low has occurred. Perhaps I over-explained what I was looking for. Thanks (y)
 
Last edited by a moderator:

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

Good morning. I'm looking for a scan script (daily) that will show me securities where the 2-period SMA crosses above the 9-period SMA after the 52-week low has occurred. Perhaps I over-explained what I was looking for. Thanks (y)

Hi number9, I decided to tackle this one today... I ended up approaching it in 3 different ways and the one here seems the best fit to your guidelines.

It plots a large magenta arrow whenever prices during the past week have reached a 52 week low and the SMA2 crosses up over the SMA9. Technically, the inputs are set as "if prices have hit a 260 day low (5 days/week x 52 weeks) during the past 5 trading days (the past week), and the SMA2 crosses up over the SMA9, then print an arrow".

The two SMA lengths and the 52 week low and the number of recent trading days over which a new low has occurred are all adjustable in the inputs.

I set it to be true for a new stock screen with close at least 10 and volume at least 500,000 and got a half dozen hits including the stock shown in the chart below.

Code:
# MAcross_after_Low
# number9 request: SMA2 crosses above SMA9 after this week reaches a 52 week low.

input fastLength = 2;
input slowLength = 9;
input distantLength = 260;
input recentLength = 5;
input avg_type = AverageType.SIMPLE;

def fastMA = MovingAverage(avg_type, close, fastLength);
def slowMA = MovingAverage(avg_type, close, slowLength);

plot Cross = fastMA crosses above slowMA and lowest(low, recentLength) <= Lowest(low, distantLength);

Cross.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
Cross.SetDefaultColor(Color.MAGENTA);
Cross.SetLineWeight(5);

Scan-MAcross-after-low-script-11-2021.png
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
304 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