Create a Stock Screener based on a Strategy
Author: Raahulsingh
Creation Date: 10/8/2009 4:17 PM
profile picture

Raahulsingh

#1
Hi,

I am new to the WLP group. I am trying to create a stock filter based on a strategy which is a mix of technicals and fundamentals. I have a dataset of stocks but I want the strategy to filter only those stocks that meet my criteria.

1. The MACD is turning towards positive for the last 2 days.
2. The current volume (today's volume) is above its 20 days average.
3. The RSI for that stock is between 20 and 40, tending up for the last 2 days.
4. The 90 day average volume is > 50000
5. Return of Equity >= 10%
6. Earnings yield > 3.00

How can run such a strategy and screen stocks that meet my criteria. Any help will be much appreciated.
profile picture

Cone

#2
To get started, you can always find at least some of these conditions in the Rule Builder. And, to make a Screener out of the result, instead of a Strategy, see the guidance in the WealthScript Programming Guide. (Search for Screener).

Anyway once you've done a few of these, it only takes a few minutes to knock it out. 90% of the code below is straight from the Rule Builder (and most of it is plotting indicators, which really isn't need for a screener, but it helps you verify that everything is working right.)

See the Guides for "How to Run Example Code".

CODE:
Please log in to see this code.
profile picture

Raahulsingh

#3
Thanks Cone. I appreciate your taking the time to help me with the strategy. I went through the Create a Screen section of the 'WL Programming Guide' and it says that the screener will show alerts but when I execute the code, no alerts come up. Even if I change come conditions like RSI Limits. I extended the RSI limits to go between 0 and 80 - Still no alerts. Am I missing something.

Thanks again.
profile picture

Eugene

#4
Have you updated Fidelity fundamental data? Do you get any plot on the top 2 chart panes?
profile picture

Cone

#5
Per your requirements, every one of the conditions must be true to Alert. Take a look at the chart for the stocks that you think should be Alerting. All the information is there to show you why it's not.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).