Create an index: number of stocks above SMA
Author: rctrade
Creation Date: 2/17/2019 8:12 PM
profile picture

rctrade

#1
I wanted to create a few index's against the S&P, as an example.
1. The number of stocks above a 200dSMA, and a 40dSMA.
according to wiki I can do this be,
1. Selecting a SMA indicator
2. Configure it's settings - Period, Source, line Width, Style, color
3. Enter the value for indicator to be above and below.
A couple of questions,
When I add an SMA indicator to a graph, the properties(Settings) doesn't give me the options I'm looking for to make this indicator represent: i.e. Number of stocks in S&P above their 200dSAM.
Am I misunderstanding the interpretation of: Number of Stocks Above or below an indicator value?
Is there a different way to accomplish this?
Thank you
rctrade
profile picture

Eugene

#2
QUOTE:
1. The number of stocks above a 200dSMA, and a 40dSMA.

The SMA indicator is just not the right tool for the job. No technical indicator you find in the Indicators list per se is sufficient. For the correct way check out "Index-Lab®" chapter in the Wealth-Lab User Guide (Help menu). Once you grasp the concept of Index-Lab, give a try such IndexDefinitions as "Above 200 SMA" and "Above (Below) Indicator's Value".
profile picture

rctrade

#3
Thank you Eugene, missed this - looks like it does what I would like.
rctrade
profile picture

Eugene

#4
You're welcome Ralph. One point I missed: unlike "Above 200 SMA" the "Above (Below) Indicator's Value" indexes are not included with WLP. They're part of MS123 IndexDefinitions library - an extension which contains additional indices (see list in the Wiki). Restart WLP after installation; for a how-to see this illustrated tutorial and/or the Wealth-Lab User Guide > Extension Manager.
profile picture

Eugene

#5
A not so convenient but quick alternative to Index-Lab may be to create and update the S&P DataSet and then count the number of stocks above an SMA right in Strategy code. This example should get you going: Number of stocks above their moving average for N periods
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).