Error Getting the EUR.USD Historical data using R on Ibrokers
Asked Answered
F

2

6

I am using the IBrokers package and twsInstrument and for some reason it gives me an error using the simplest of methods.

require("IBrokers")
require("twsInstrument")
tws <- ConnectIB()
past.data<-reqHistoricalData(tws,getContract("EUR.USD"))

gives me

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

Any ideas on how to fix this?

Fae answered 27/5, 2012 at 23:2 Comment(0)
D
12

Interactive Brokers does not disseminate TRADES data for cash FX. You need to use a different value for whatToShow than the default. For example:

 reqHistoricalData(tws,getContract("EUR.USD"), whatToShow="BID")
 #or
 reqHistoricalData(tws,getContract("EUR.USD"), whatToShow="ASK")
Drummond answered 28/5, 2012 at 0:51 Comment(0)
P
1

As of 2021 this is what you can choose from: enter image description here

and enter image description here

taken from https://interactivebrokers.github.io/tws-api/historical_bars.html

Paleethnology answered 9/10, 2021 at 22:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.