How to scan for stock that trend above a 200-day EMA in a specific period


New member
Hi all, chanced upon this forum while googling for some trading indicator queries, and glad that I found this community. I am new to trading and thinkorswim, and has just started to look into a more systematic way of trading with a plan and a set of rules.

I was trying to backtest a strategy that scan for stocks which are trending above a long-period EMA 200 or 233 (meaning the stock price never falls below the EMA 200 or 233) over a 90 days period. Next is to look for pullback when the EMA13 crossover down the EMA34, but the stock price is still above the EMA233 line. Is there such a indicator for scanning pullback of a trending stock?

I manage to explore the scan filters in the thinkorswim scan>stock hacker section, which I set up to match 2 of the above criteria:
Study> MovingAverage_Scan : the close is at least 0.01% above 233 period EMA
Study> MovingAvgCrossover: 13 period EMA crosses below 34 period EMA price close

But I am unable to find any study that can scan for the criteria of the stock trending up and its price never falls below the EMA 200 or 233 over a 90 days period.

Appreciate if any experienced traders can help to advise... Thanks :)

Edited: just found this on reddit about trendline:

post link:
Not sure if it is applicable to use the code, and scan for stocks that fits the trendline criteria and also have its price above the EMA 233 over a 90 days period.
Last edited:

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