• Get $40 off VIP by signing up for a free account! Sign Up

2-step price action relative to MA


Greetings! I'd like to come up with a script for TOS that returns scan results for the following 2-step price action:

1st price closes below 12 day ExpAverage
2nd price closes above 12 day ExpAverage

Upon close of the 2nd price, the results would then be presented in the scan.

I would then modify the code to do the opposite to produce another scan that reverses the scenario.

I'm new to thinkscript and not sure how to start with this seemingly straightforward task. Hope I made the request clear enough.

Thanks in advance for your assistance!

You can do this with the built in ThinkorSwim Scanner. Add new filter, select study, then you will get this menu.

Put the first moving average as 1. That is the current close. Then the second moving average as whatever you want, such as 12.

Thank you for the quick reply. You're exactly right in this approach producing the results as I had explained. I wasn't clear enough in the detail of that FIRST price . . . it would be one that opened above the EMA and then closed below the EMA. Another way of describing what I'm after would be a sell signal candle followed by a buy signal candle. Sorry for the confusion.

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
356 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.