150 SMA Scan Help

cdweaver333

New member
Hey there...I'm attempting to capture the crest of 150 SMA's as stocks move from Stage 2 into Stage 3.

I would post some photos but imgur isn't loading today for some reason...

Let's use PTON as the first example...there's a huge stage 2 runup but in late April/early May of 2021, the 150 SMA starts to crest and go sideways. This lets me know there's a potential for a big selloff if the stock stays in stage 3 and moves to stage 4.

5/3/21 - 150 SMA is 123.95
5/4/21 - 150 SMA is 123.95
5/5/21 - 150 SMA is 123.83

In scan filters, I can compare today's 150 SMA to yesterday's. If I try to compare to compare 150 SMA from 2 bars ago to 150 SMA from 1 bars ago, I get an invalid statement...

Essentially, I hoping to view any stocks where -
150 SMA < 150 SMA from 1 Bar Ago AND
150 SMA from 1 Bar Ago is greater than or equal to 150 SMA from 2 Bars Ago...

Devon

Solution
Ruby:
``````SimpleMovingAvg("length" = 150)."SMA" is less than SimpleMovingAvg("length" = 150)."SMA" from 1 bars ago
and
SimpleMovingAvg("length" = 150)."SMA" from 1 bars ago is greater than or equal to SimpleMovingAvg("length" = 150)."SMA" from 2 bars ago``````
Ruby:
``````SimpleMovingAvg("length" = 150)."SMA" is less than SimpleMovingAvg("length" = 150)."SMA" from 1 bars ago
and
SimpleMovingAvg("length" = 150)."SMA" from 1 bars ago is greater than or equal to SimpleMovingAvg("length" = 150)."SMA" from 2 bars ago``````

Not the exact question you're looking for?

87k+ Posts
315 Online

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

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?