[R-SIG-Finance] Problem with getFX

Owe Jessen list at econinfo.de
Wed Jul 7 23:02:23 CEST 2010


Thanks for the reply. This is the traceback:

 > traceback()
6: stop("NROW(x) must match length(order.by)")
5: xts(as.numeric(fr[1:length(fr)%%2 != 1]), as.Date(fr[1:length(fr)%%2 ==
        1], "%m/%d/%Y", origin = "1970-01-01"), src = "oanda", updated = 
Sys.time())
4: getSymbols.oanda(Symbols = Currencies, from = from, to = to,
        env = env, verbose = verbose, warning = warning, auto.assign = 
auto.assign,
        ...)
3: getFX("EUR/GBP", from = (Sys.Date() - 499), to = Sys.Date())
2: get(getFX("EUR/GBP", from = (Sys.Date() - 499), to = Sys.Date()))
1: xts(get(getFX("EUR/GBP", from = (Sys.Date() - 499), to = Sys.Date())))
 >
Sys.Date seems to exist.
 > Sys.Date()
[1] "2010-07-07"

getSymbol works fine for anything but oanda.

Still at a loss there.
> Just used exactly the code below and it still works fine for me.
>
> Maybe show the callstack with traceback to see where it failed?
>
> Maybe Sys.Date isn't a date on your machine (I am speculating now)?
>
>   Wolfgang Wu
>
>
>
> ----- Ursprüngliche Mail ----
> Von: Owe Jessen<list at econinfo.de>
> An: r-sig-finance<r-sig-finance at stat.math.ethz.ch>
> Gesendet: Mittwoch, den 7. Juli 2010, 12:20:33 Uhr
> Betreff: [R-SIG-Finance] Problem with getFX
>
> Hi,
>
> I was just trying Wolfgang Wu's loop to load long histories of FX from oanda,
> but get the following error message.
>
>
> Fehler in xts(as.numeric(fr[1:length(fr)%%2 != 1]), as.Date(fr[1:length(fr)%%2
> ==  :
>    NROW(x) must match length(order.by)
> Zusätzlich: Warnmeldungen:
> 1: In readLines(tmp) :
>    unvollständige letzte Zeile in
> 'C:\DOKUME~1\Owe\LOKALE~1\Temp\RtmpxZe1Dw\file5f906952' gefunden
> 2: In xts(as.numeric(fr[1:length(fr)%%2 != 1]), as.Date(fr[1:length(fr)%%2 ==  :
>    NAs durch Umwandlung erzeugt
>
> Has anybody an idea what went wrong?
>
>
> library(xts)
> library(quantmod)
> EURGBP<- xts(get(getFX('EUR/GBP', from = (Sys.Date() - 499), to = Sys.Date())))
> for (iDate in seq(500, 2000, by=500)){
>      EURGBP<- rbind.xts(EURGBP, get(getFX('EUR/GBP', from = Sys.Date() - iDate -
> 499, to = Sys.Date() - iDate)))
> }
> colnames(EURGBP)<- "Close";
> chartSeries(EURGBP)
>
> -- Owe Jessen
> Nettelbeckstr. 5
> 24105 Kiel
> post at owejessen.de
> http://privat.owejessen.de
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should
> go.
>
>
>
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
>
>    


-- 
Owe Jessen
Nettelbeckstr. 5
24105 Kiel
post at owejessen.de
http://privat.owejessen.de



More information about the R-SIG-Finance mailing list