How can one get historical financial data of S&P 500 Index? Is this data available in Mathematica?
This command results in missing data:
In[1]:= data = FinancialData[“^SPX”, {“1/1/2012”, “12/31/2012”}]
Out[1]]= Missing[“NotAvailable”]
How can one get historical financial data of S&P 500 Index? Is this data available in Mathematica?
This command results in missing data:
In[1]:= data = FinancialData[“^SPX”, {“1/1/2012”, “12/31/2012”}]
Out[1]]= Missing[“NotAvailable”]
FinancialData appears to have some problems at the moment (and in recent days). So, for example your problem returns no data. And also the following from the documentation
DateListLogPlot[FinancialData["^DJI", All]]
returns
DateListLogPlot[Missing["NotAvailable"]]
Perhaps someone from WRI can comment on these issues and any related ones?
Note that if one goes to Wolfram|Alpha and asks it about these financial instruments (e.g.: “S&P 500 Index since 2009”) it returns the following note:
Maintenance Notice:Reports for finance-related queries may be returning fewer results than usual.
We appreciate your patience as we work through an update to our financial data infrastructure.
This note has been there for a some days now. So perhaps some further explanation of what the issue is will be forthcoming.
WRI in-house cognoscenti, any background on this behavior?
–Curious in Boston
I am not really sure about the current problems with FinancialData, but some time ago in this community someone did discuss the command:
DateListLogPlot[FinancialData["^DJI", All]]
Someone from Wolfram said that that would not work anymore because the data was provided by Yahoo, and they do not provide ^DJI anymore. So no matter what the current problems are, that particular function will not work anymore. Oh, one second, …
here’s the post by Sean Clarke:
I am not sure whether this is related/helps.
Cheers,
Marco
Anybody have news on how long it’s going to take them to fix the missing financial data?
The reason that ^DJI isn’t being served is that Yahoo finance is no longer serving the data. Yahoo finance is no longer serving it because the company which own the rights to that data has decided that it shouldn’t be available through their API. (Help for Yahoo Finance for Web)
I would not expect this to change in the near future. If you need this financial data, it is probably best to find an alternate source of it. For Financial things, I often find Quandl useful: http://www.quandl.com/BCB/UDJIAD1
Given how often these sources availability change, you will need multiple sources of it. This is frustrating and part of the reason people pay for subscription services like Bloomberg.
Wolfram|Alpha used to be able to serve ^DJI via MorningStar. I’m not sure what has recently happened with that.
This code below manually pulls out the DJI members and gets their prices. This might be useful instead.
djiaMembers=WolframAlpha["Dow Jones members",{{"Result",1},"ComputableData"},PodStates->{"Result__More"}];
members=WolframAlpha["company "<>#,"WolframResult", TimeConstraint->60]& /@ djiaMembers;
mem=EntityValue[#,"Symbol"]& /@ Cases[members,Except[_Missing]];
findata=FinancialData[#,"Price",{{2000},{2010},"Month"}][[All,2]]&/@mem[[-12;;-3]];
Thank you Sean, Quandl looks very promising for lots of things. Appreciate the info and the link. Also the nice bit of code.
This post solutions are relevant: How to get FinancialData[] Exchange Rates ?