Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple function of quantmod not working anymore

Tags:

r

quantmod

I am turning in my thesis tomorow and I'm getting a very bizzare error message with quantmod which I never had during the last weeks while working with this package. I can't manage to import data specificly of Dow Jones index (^DJI). I get the following error message:

getSymbols("^DJI",src="yahoo", from='2005-6-01', to='2012-6-21')

Error in download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  : 
impossible to open the URL 'http://chart.yahoo.com/table.csv?s=^DJI&a=5&b=01&c=2005&d=5&e=21&f=2012&g=d&q=q&y=0&z=^DJI&x=.csv'
Also : Message d'avis :
In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  :
impossible to open : the status HTTP was '404 Not Found'

I almost feel embarased to ask such a simple question. I really don't understand where the problem is.. these for example work just fine

getSymbols("AAPL",src="yahoo", from='2005-6-01', to='2012-6-21')
getSymbols("^NDX",src="yahoo", from='2005-6-01', to='2012-6-21')

So where is the problem? thank you very much for your help I really appreciate it !

like image 904
jeremy.staub Avatar asked Jul 05 '12 02:07

jeremy.staub


1 Answers

For some reason, yahoo does not currently provide that data. You can see on the yahoo website that it currently says "Historical quote data is unavailable for the specified date range."

I do not know ifthis is temporary or permanent, but I would guess that it is temparary because as you noted, "^NDX" still works. Since today is a holiday in the United States, it is possible that Yahoo is doing maintenance.

If it becomes available before it is too late for you, I would suggest saving the data either with save or with FinancialInstrument:::saveSymbols.common so that you could load it back using getSymbols(*, src='FI')

If it's not up by the time you need it, you have a couple alternatives that may or may not suit your needs. You could use getSymbols.FRED to get the closing values of the index since 1886

getSymbols("DJIA", src='FRED')

Or, you could use the DIA ETF which is actually tradeable and is a decent proxy for the index

getSymbols("DIA", src='yahoo')
like image 169
GSee Avatar answered Oct 14 '22 04:10

GSee