How can I use FinancialData
to get the ticker symbols for a given index? For example suppose I want the tickers for all 500 stocks currently listed on the S&P 500. Can FinancialData
give me these tickers?
-
1$\begingroup$ In general, yes: FinancialData["Frankfurt", "Members"] Having problem with S&P500 though. $\endgroup$– V.E.Oct 13, 2016 at 18:04
1 Answer
As the example in the documentation shows
FinancialData["^GSPC", "Members"]
should work, but it unfortunately returns
Missing["NotAvailable"]
A working alternative is to use
EntityList[EntityClass["Financial", "SP500"]]
instead. However, it has 506 entries and it is unclear when its last update was.
If you prefer the symbols as strings instead of entities, you can use
EntityValue[EntityClass["Financial", "SP500"], "Symbol"]
-
$\begingroup$ Wiki says there are 505 of these stocks, contrary to what the index name implies. $\endgroup$ Oct 13, 2016 at 18:22
-
$\begingroup$ @J.M. based on that list,
EntityList[EntityClass["Financial", "SP500"]]
is not up-to-date. $\endgroup$ Oct 13, 2016 at 18:34