Greetings,

Is anybody here using the IB API and R to download historical FX data?  I
couldn't find any references to success or failure using RSeek or Googling.

The response my attempts elicit suggest that the data isn't available,
though I can fetch the same without problem using ActiveX/Excel. As I'm a R
neophyte, I'd like to check firstly if my code is incorrect in my various
attempts. Note that I've had no problem retrieving quotes and market data
for the same currency:

[1] "GBPJPY"
> GBPJPY <- getContract("GBPJPY")
> get_quote("GBPJPY")
2 -1 2104 Market data farm connection is OK:usfuture
2 -1 2104 Market data farm connection is OK:hkfarm
2 -1 2104 Market data farm connection is OK:cashfarm
2 -1 2104 Market data farm connection is OK:usfarm
2 -1 2106 HMDS data farm connection is OK:ushmds2a
        BidSize BidPrice AskPrice AskSize
GBP.JPY   2e+06  131.275   131.31 1.5e+07

 > reqMktData(tws,twsCurrency("GBP"))
<20120314 18:03:20.843750> id=1 symbol=GBP bidPrice: 1.57055  bidSize:
14310000
<20120314 18:03:20.843750> id=1 symbol=GBP askPrice: 1.57065  askSize:
1000000
<20120314 18:03:20.843750> id=1 symbol=GBP bidSize: 14310000
<20120314 18:03:20.843750> id=1 symbol=GBP askSize: 1000000
<20120314 18:03:20.843750> id=1 symbol=GBP highPrice: 1.57460

> reqHistoricalData(tws, Contract=contract)
TWS Message: 2 -1 2104 Market data farm connection is OK:usfuture
TWS Message: 2 -1 2104 Market data farm connection is OK:hkfarm
TWS Message: 2 -1 2104 Market data farm connection is OK:cashfarm
TWS Message: 2 -1 2104 Market data farm connection is OK:usfarm
TWS Message: 2 -1 2106 HMDS data farm connection is OK:ushmds2a
waiting for TWS reply on GBP ....failed.
NULL
Warning message:
In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
  Historical Market Data Service error message:No data of type EODChart is
available for the exchange 'IDEAL' and the security type 'Forex' and '1 m'
and '1 day'

> reqHistoricalData(tws,Contract=contract,endDateTime='20120302 17:00:00
GMT', barSize='1 day', duration='2 W', useRTH="0",
whatToShow='MIDPOINT',file="")
waiting for TWS reply on GBP .....failed.
NULL
Warning message:
In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
  Historical Market Data Service error message:No data of type EODChart is
available for the exchange 'IDEAL' and the security type 'Forex' and '2 W'
and '1 day'

 > reqHistoricalData(tws,twsCurrency("GBP"))
waiting for TWS reply on GBP ....failed.
NULL
Warning message:
In errorHandler(con, verbose, OK = c(165, 300, 366, 2104, 2106,  :
  Historical Market Data Service error message:No historical market data
for GBP/CASH@IDEALPRO Last 1d

Appreciate corrections or advice, thank you

Glenn

	[[alternative HTML version deleted]]

