2
$\begingroup$

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?

$\endgroup$
  • 1
    $\begingroup$ In general, yes: FinancialData["Frankfurt", "Members"] Having problem with S&P500 though. $\endgroup$ – V.E. Oct 13 '16 at 18:04
2
$\begingroup$

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"]
$\endgroup$
  • $\begingroup$ Wiki says there are 505 of these stocks, contrary to what the index name implies. $\endgroup$ – J. M. will be back soon Oct 13 '16 at 18:22
  • $\begingroup$ @J.M. based on that list, EntityList[EntityClass["Financial", "SP500"]] is not up-to-date. $\endgroup$ – Karsten 7. Oct 13 '16 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.