# FinancialData property value at a given date

I was trying to get the volatility value of a specific equity on a given day.

Based on the Mathematica Help, the syntax is

FinancialData["name","prop",{start,end,...}] gives a list of dates and values of a property for a sequence of dates or periods.

So I tried this with the specific request.

FinancialData["SPY", "Volatility20Day", {{2012, 10, 11}, {2012, 10, 11}}]


which generates a long error message that starts with DatePlus::date: Argument {{2012,10,11},{2012,10,11}} cannot be interpreted as a date. >>

By the way, the syntax does work with other properties such as close, open, return, etc.

Is there any specific syntax that is different for Volatility20Day?

• FinancialData["SPY", "Volatility20Day", {2012, 10, 11}] – David Slater Oct 29 '12 at 14:38
• Hi David, the function will return a list, all volatility values from that date forward to the present, and not the specific date value. I used that approach combined with First to get what I needed, but it does get time intensive as I need to explore market behavior further down the past. That is why I was wondering what the correct syntax should be so as not having to bring all values to then discard them all except the one Im interested in. – Zviovich Oct 29 '12 at 14:43
• mmm .... seems a bug – Dr. belisarius Oct 29 '12 at 15:01
• Bug reported to Wolfram. This is their response. Hello, Thank you for your email. I've reproduced this behavior with FinancialData and filed a report with our developers on the subject. Your contact information has been appended to the report so that you can be notified when this issue is addressed. Please let me know if you experience any further problems in Mathematica. – Zviovich Nov 5 '12 at 21:09
• This is the response from Wolfram Support.I apologize for the delay in responding. I have forwarded your example to our developers so that they can take a deeper look into this issue and resolve it for a future version of Mathematica. I apologize, I have not been able to find a syntax that allows your query without using the First function. It is possible to get this data through WolframAlpha: support.wolfram.com/kb/7357 However this isn't necessarily more efficient. If you do see any other issues like this one, please let us know. – Zviovich Nov 13 '12 at 13:07

Ran into this 2012 question and thought it deserves some closure. The issue is resolved at least in the current

In[]:= \$Version
Out[]= 12.1.1 for Mac OS X x86 (64-bit) (June 9, 2020)


This code will return a single element TimeSeries:

data=FinancialData["SPY","Volatility20Day",{{2012,10,11},{2012,10,11}}]


with value

In[]:= Values[data]
Out[]= {8.29364%}


Note, now you can also go another way around it:

In[]:= SemanticInterpretation["SPY Volatility 20 Day on OCT 11 2012"]
Out[]= 8.29364%


This uses Wolfram|Alpha Entity framework. You can get code it used via free-from input interface (press = at the beginning of the cell or CTRL+= anywhere in-code):

with InputForm (CMD+Shift+I) code of that yellow boxes being

In[]:= Entity["Financial", "NYSE:SPY"][EntityProperty["Financial",
"Volatility20Day", {"Date" -> DateObject[{2012, 10, 11}]}]]
Out[]= 8.29364%