[R-SIG-Finance] Futures prices in quantmod?

Guillaume Yziquel guillaume.yziquel at citycable.ch
Tue Dec 8 03:58:23 CET 2009


Konrad Hoppe a écrit :
> Hi Guillaume,
> 
> I tried a future from the first site you presented below. And you can load
> futures prices in the same way you use for "normal" assets:
> 
> from.dat <- as.Date("01/01/03", format="%m/%d/%y")
> to.dat <- as.Date(Sys.Date(), format="%m/%d/%y")
> 
> getSymbols("^XAU", src="yahoo", from = from.dat, to = to.dat)
> 
> regards
> Konrad

Not so sure. ^XAU is quite weird, when you compare it to XAU: Exactly 
the same data, but XAU ends 7 months ago. I'm not even sure that ^XAU is 
a future. It seems to me (but I may well be mistaken) that one cannot 
downloads historical prices for futures.

Here's a real future:

> > getQuote("DJZ09.CBT")
>                    Trade Time  Last Change % Change  Open  High   Low Volume
> DJZ09.CBT 2009-12-07 04:14:00 10391     -9   -0.09% 10365 10430 10327      0
> > getSymbols("DJZ09.CBT")
> Erreur dans download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  : 
>   impossible d'ouvrir l'URL 'http://chart.yahoo.com/table.csv?s=DJZ09.CBT&a=0&b=01&c=2007&d=11&e=08&f=2009&g=d&q=q&y=0&z=DJZ09.CBT&x=.csv'
> De plus : Message d'avis :
> In download.file(paste(yahoo.URL, "s=", Symbols.name, "&a=", from.m,  :
>   ouverture impossible : le statut HTTP était '404 Not Found'

getQuote works, getSymbols doesn't.

I believe the XAU/^XAU thing is not a future, but the Philadelphia index 
itself.

All the best,

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/



More information about the R-SIG-Finance mailing list