Hi guys,
Is there a best way to subset to a major index from usstock-1d?
I.E. The 500 Tickers for the S&P500. Something like this in the get_prices()
call:
prices = get_prices('usstock-1d', sids=[LIST_OF_500_SIDS], start_date='2020-10-05')
Sure I can find this list of TICKERS on the internet with this example:
import pandas as pd
table=pd.read_html('List of S&P 500 companies - Wikipedia')
df = table[0]
df.to_csv('S&P500-Info.csv')
df.to_csv("S&P500-Symbols.csv", columns=['Symbol'])
list_of_sp_tickers = np.array(pd.read_csv('S&P500-Symbols.csv', index_col=0)['Symbol'])
print(*list_of_sp_tickers, sep=' ') # Copy output
Then feed into
!quantrocket master get --exchanges ARCA NASDAQ NYSE --symbols COPIED_OUTPUT | quantrocket master universe 'sp500' -r -f -
But the MSCI USA Small Cap Index would be harder to track down with something like 1,717 tickers and is less common.
Thanks in advance!