BUG: alphien.data.getTickersSP500 does not provide complete constituents for some period

I noticed alphien.data.getTickersSP500() is not accurate (or at least does not provide the full SP500 contituents) on some periods. For example, there are at most 474 provided tickers at the start of 2008.


Code to reproduce:

import alphien
ticker_dataframe = alphien.data.getTickersSP500()
start_before_2008 = ticker_dataframe[‘constituentStart’] <= ‘2008-01-01’
ticker_dataframe[start_before_2008].shape

Output

(474, 6)


Ideally we would like to get the full constituents on any given period so we can simulate information ratio.

Hi Leon0183,


unfortunately there are some tickers where we do not have the full price data on which was why some tickers are excluded from the function. To simulate information ratio, you could use close price of ticker SPW Index which is in getTickersSP500Data(). This ticker was just added to the python version of the function, apologies for the mismatch. Simply call:


R

.sourceQlib()
close = getTickersSP500Data(ticker = “SPW Index”, asXts = TRUE)


Python