bug in fImport:::oandaSeries

Søren Feodor Nielsen sfn.mes at cbs.dk
Fri Feb 4 16:03:54 CET 2011


Hi

In oandaSeries the arguments from, to and nDaysBack are not passed on to 
oandaImport so the actual data-fetching is done using oandaImport's default 
values. This means that one cannot get data dating back more than one year 
from today's date when using oandaSeries.

This should be easily fixed by changing

 	X = oandaImport(query = symbols[1], ...)@data

to

 	X = oandaImport(query = symbols[1], from = from, to = to,
 		nDaysBack = nDaysBack, ...)@data

and

 	X = merge(X, oandaImport(query = symbols[i], ...)@data)

to

 	X = merge(X, oandaImport(query = symbols[i], from = from, to = to,
                 nDaysBack = nDaysBack, ...)@data)

The lines

     if (is.null(from))
         from = to - nDaysBack * 24 * 3600
     X = window(X, from, to)

are probably superflous once the bug is fixed.

I think the same bug appears in fredImport and yahooImport.

Best regards

Feodor



More information about the Rmetrics-core mailing list