Need help with writing a scan

rbaughmanusmc

New member
Good Morning,

Im looking for anyone to help with writing a scan for thinkorswim.

I need help with
price close greater than 8 day moving avg exp for 1 previous daily bar
Price close greater than 8 day moving avg exp for 2 previous daily bars
Price close less than 8 day moving avg exp for current daily candle
Declining 17 day moving avg exp for 10 days looking back 5 days previous
Current daily candle to be bearish.

If anyone could help me with writing a code I would greatly appreciate it. Thank you
 
Good Morning,

Im looking for anyone to help with writing a scan for thinkorswim.

I need help with
price close greater than 8 day moving avg exp for 1 previous daily bar
Price close greater than 8 day moving avg exp for 2 previous daily bars
Price close less than 8 day moving avg exp for current daily candle
Declining 17 day moving avg exp for 10 days looking back 5 days previous
Current daily candle to be bearish.

If anyone could help me with writing a code I would greatly appreciate it. Thank you

See if this helps. Found 207 symbols on All Stocks Scan run on Daily.

Code:
input agg = AggregationPeriod.DAY;

input averageType = AverageType.EXPONENTIAL;

input length = 8;
def ma = MovingAverage(averageType, close(period = agg), length);

input length1 = 17;
def ma1 = MovingAverage(averageType, close(period = agg), length1);

def cond1 = close[2] > ma[2];
def cond2 = close[1] > ma[1];
def cond3 = close < ma;
def cond4 = ma1[6] > ma1[5];
def cond5 = close < open;

plot scan = cond1 + cond2 + cond3 + cond4 + cond5 == 5;
 

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