Questions tagged [ibrokers]

`IBrokers` is an R package that provides a native `R` interface to Interactive Brokers Trader Workstation trading platform.

IBrokers is an R package that provides a native R interface to Interactive Brokers Trader Workstation trading platform.

75 questions
3
votes
0 answers

IBrokers Data persistence

I am trying to store persistent values using the reqRealTimeBars() function of the IBrokers library in order to call some trading logic in the eWrapper function. I have searched the list and gone over Jeff Ryan's slides from various talks he has…
rfitz543
  • 31
  • 2
3
votes
1 answer

R IBrokers. How to get currency contract to work in reqHistoricalData calls? e.g. CADUSD rates? And how to pull index prices? e.g. S&P, DJI?

I am currently learning how to use the IBrokers package. I can pull equity prices at frequencies I want, and option prices, but I'm currently stuck on pulling foreign exchange rates. I don't know how to set up the right twsContract, for calling with…
FXQuantTrader
  • 6,821
  • 3
  • 36
  • 67
2
votes
2 answers

Pulling option chain with IBrokers

Like this: opt<-reqContractDetails(tws,twsOption(local="", expiry="20111021",right="",symbol="UCO")) This is unusably slow. Is this because of IB? Any suggestions on how to get an option chain returned in less than 10 minutes? thanks
Pauly
  • 101
  • 7
2
votes
1 answer

IBrokers R package: issue with class twsconn (R)

At the moment, I am switching from Python to R and I am trying to write some simple code to price a portfolio, using Jeff Ryan's Ibrokers package. I would like to have a field of class twsconn in one of my objects setClass( "MktAsset", …
Johnny
  • 31
  • 1
2
votes
1 answer

How to handle errors from reqMktData calls

Are there any examples on the net how to process errors when downloading data from Interactive Brokers using the IBrokers package? I've had a look at the package details and eWrapper and twsCALLBACK seem to handle this but I can't get them to work.…
Zeus
  • 1,496
  • 2
  • 24
  • 53
2
votes
1 answer

How to request delayed market data with IBrokers

Is there a way to request delayed market data as mentioned at TWS API v9.72+: Market Data Types I am particularly looking for setting client.reqMarketDataType(3); This post works in python but I want to do it in R using IBrokers Thank you!
Santosh
  • 192
  • 1
  • 9
2
votes
1 answer

How to get data of filled orders in R using IBrokers?

I am trying to fetch the performance of my historical trades. Does anyone know if there's a way to pull a similar table like what I have below, but for historical trade logs? Thanks! > tws <- twsConnect() > ac <- reqAccountUpdates(tws) > position <-…
2
votes
0 answers

Message management using eWrapper and twsCALLBACK in IBrokers

I am trying to understand IBrokers package for interactive brokers API but am finding it extremely hard to understand the use of EWrapper methods. While I do understand that reqMktData is used to get real time data, I am not sure how to use it with…
user1434997
  • 1,689
  • 2
  • 12
  • 12
2
votes
1 answer

R IBrokers API fails to reqHistoricalData for expired months

In an effort to download data from IB into R I have followed the steps here: IBrokers request Historical Futures Contract Data?. Which are about the same as here: https://cran.r-project.org/web/packages/IBrokers/vignettes/IBrokers.pdf. It all works.…
Krug
  • 1,003
  • 13
  • 33
2
votes
1 answer

IBrokers R - reqFundamentalData

Trying to download fundamental data using the IBrokers - R package. API documentation shows two ways http://xavierib.github.io/twsapidocs/interfaceIBApi_1_1EWrapper.html#af209070fa9583fb4780be0f3ff1e61e4 or…
Jai
  • 321
  • 1
  • 8
2
votes
1 answer

IBrokers: queueing up an order using R

I'm trying to do a simple order through the Interactive Brokers API using R. For example, I'm trying to buy 1 share of IBM and short 1 share of MSFT. I cannot find any documentation on how to do this step in R. Does anyone have familiarity…
Trexion Kameha
  • 3,362
  • 10
  • 34
  • 60
2
votes
1 answer

Get nse equity data using r package 'ibroker'

I'm unable to get equity data from NSE (Indian stock exchange) through ibrokers package of R. Setting the 'exch' to 'NSE' doesn't work. I tried with the following code tws = twsConnect() contract = twsEquity(symbol = 'SBIN', exch =…
kay dee
  • 53
  • 9
2
votes
1 answer

IBrokers twsFOP call in R

I'm trying to get the following to pull some data from IB (Nasdaq 100 e-mini futures options data). I am using the snapShot callback (included below). Could someone tell me what is wrong with my code? require(IBrokers) tws <- twsConnect() test3<-…
jd8585
  • 187
  • 1
  • 8
2
votes
0 answers

Receive real-time market data in R by iBroker

I am a beginning trader who is just using iBrokers package of R for algorithm trading. My goal is to let R implement a strategy instantly when I get the right signal(market price). But now I am stuck at the point that when I call function…
user3284048
  • 103
  • 1
  • 1
  • 5
1
vote
1 answer

R IBrokers reqopenorders not updating

I am querying the list of pending orders in TWS Interactive Brokers using codes from the IBrokers package. The function reqOpenOrders(tws) has an error in it, in that it hangs as shown here, and even when it works the outputs are messy as shown…
Camilo
  • 153
  • 7