# Historical S&P500 prices using FinancialData[

After some poking around, I found how to get the price of the S&P500:

FinancialData["^SPX"] and FinancialData["^SPX", "Company"]


However, I am trying to illustrate the calculation of betas, so I need historical prices, but putting past dates (for example FinancialData["^SPX", DateObject[DatePlus[Today, -90]]]) gives Missing[NotAvailable]. My workaround has been to use an index fund instead, but I would strongly prefer doing this the right way. Any ideas about how to get historical data for the S&P500 with FinancialData[ ]?

By the way I did consult these answers, but

WolframAlpha["s&p500 prices from 10/23/2015 to 10/22/2016",{"DateRangeSpecified:Last:FinancialData"}]

does not produce a TimeSeries list. And, yes, I know that if I was connected to Bloomberg, then an interface exists, I am not.

• Have a look at this. – b.gates.you.know.what Oct 23 '16 at 16:26
• Oof, that works but doing it in four month intervals is a pain. Thanks, I upvoted your comment. – Nicholas G Oct 23 '16 at 22:15

Try using Entity to feed FinancialData:
ts = TimeSeries[FinancialData[EntityClass["Financial", "SP500"], {{2016, 1, 1}, Today}]]

• Using "SP500" instead of EntityClass["Financial", "SP500"] returns the same data. – Karsten 7. Oct 24 '16 at 5:50
• The symbol "^GSPC" also returns the same data. – Karsten 7. Oct 24 '16 at 5:57
• Thanks all. Wrapping in TimeSeries[ ] would not produce a list that I could then use to calculate and graph relations with stocks. But it turns out that FinancialData["SP500", {{2014, 10, 23}, {2016, 10, 22}}] worked just fine. How could I have found the correct symbol string? I searched for all symbols containing SP with FinancialData["*SP*", "Lookup"] but it did not produce SP500. – Nicholas G Oct 24 '16 at 13:08
• @Karsten7. This is my feeble attempt to use the Entity framework which is still almost indecipherable to me. :) – kale Oct 24 '16 at 13:48