How to include Percent of S&P stocks above 50 MA in my system?
Author: Doron
Creation Date: 6/1/2019 6:57 PM
profile picture

Doron

#1
Hi,

I would like to include the daily $SPXA50R index (S&P Percent of stocks above 50 MA) in my system.

Do you know how this index historical data can be downloaded?

Any help would be appreciated.

Thanks!
profile picture

Eugene

#2
Hi,

There are two ways to accomplish this:

1) One is to create an index in the Index-Lab tool: Create an index: number of stocks above SMA

In your case, take the "Above SMA" IndexDefinition.

2) And the other is to achieve this in pure WealthScript: Number of stocks above their moving average for N periods

You'll find similar code example in the QuickRef tool > Data access > DataSetSymbols Property.

Both solutions require that you create a S&P DataSet and keep it up to date in order to calculate your daily index.
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).