[R] currency conversion function?

Jeff Ryan jeff.a.ryan at gmail.com
Thu Oct 15 19:57:58 CEST 2009



OandA now limits fills to 500 days (as indicated by the error).  You can of
course just request 500 days at a time.  The function itself will not
automatically do that as that would be clearly abusing the rules that OandA
have established.  Of course what you do with your own code is your own
business...


> getFX("EUR/USD",from="2009-04-01")
[1] "EURUSD"
> head(EURUSD)
           EUR.USD
2009-04-01  1.3277
2009-04-02  1.3227
2009-04-03  1.3333
2009-04-04  1.3443
2009-04-05  1.3490
2009-04-06  1.3491


If you are looking for additional FX data, the FRED archive (St. Louis Fed)
is very good as well...

http://research.stlouisfed.org/fred2/categories/94

> getSymbols("DEXUSEU", src="FRED")
[1] "DEXUSEU"
> head(DEXUSEU)
           DEXUSEU
1999-01-04  1.1812
1999-01-05  1.1760
1999-01-06  1.1636
1999-01-07  1.1672
1999-01-08  1.1554
1999-01-11  1.1534

Keep in mind that FX data isn't coming from a centralized exchange, so all
vendors will be different.  

> ?getFX
> ?getSymbols.FRED

HTH,
Jeff

-- 
View this message in context: http://www.nabble.com/currency-conversion-function--tp25888083p25913241.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list