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
1
vote
0 answers

How to handle RSS in IBKR in TWS?

Hi, this is my first post here, so don't know about any rules here. How to ask, how to tag, etc. I'm a german stock trader, "fighting" with the TWS daily. Have to learn how to handle API stuff in the future, but actually no time to do so. Have still…
1
vote
1 answer

IBrokers R API and same day intraday prices

I think this is be an IB API more than the IBrokers R package. I am using reqHistoricalData to get 30 minutes intraday historical data. The market is open and I am not getting the same day's data. I only get yesterday's data. Is it possible to get…
Courvoisier
  • 904
  • 12
  • 26
1
vote
1 answer

Using IBrokers and R, what is the appropriate way to retrieve live trading data for multiple stocks?

Obviously, a trader can easily be monitoring 100s of stocks in a live trading session. Here is code to just retrieve live data for 30+ stock symbols: tws <- twsConnect() sym <- c("AAPL", "MSFT", "GOOGL", "TWTR", "MSFT", "BABA","JD", "WLTW", "DIA", …
1
vote
1 answer

Is there a from and a to argument for reqHistoricalData in IBrokers?

How do I get historical data with an exact start and end date? It only has a "duration" parameter: df <- reqHistoricalData(tws, Contract=contract, barSize = "1 day", duration = "2 M") Can I do something like: df <- reqHistoricalData(tws,…
1
vote
0 answers

IBrokers: Looping through a dataframe of endDateTime and twsEquity parameter pairs for reqHistoricalData in r

I am having some difficulty get the following reqHistoricalData request in IBrokers to work. I am try to feed a data frame of date time and stock tickers pair to retrieve the intraday tickers at 5 minute intervals for historical research. I am…
Dan Mack
  • 11
  • 4
1
vote
0 answers

Trouble with pulling Option Data IBrokers

I have been pulling option data from Interactive brokers for the past 2 months. Since the new year when I go to pull option data, I get this message "Error in tmp[[id]] : subscript out of bounds" Here is the code. tws = twsConnect(port = 7498) …
Jordan Wrong
  • 1,205
  • 1
  • 12
  • 32
1
vote
0 answers

continuously subscribe to the portfolio data with IBroker package?

I tried to use reqUpdateAccounts, but it is just a snapshot. I would like to monitor the portfolio on a continuous basis. I understand .reqUpdateAccounts could subscribe to the portfolio data, but don't know how to present and handle the data…
good.vibe
  • 11
  • 1
1
vote
1 answer

IBrokers Quantstrat live implementation

I am wondering if there is any simple example available of the implementation of a simple strategy from quantstrat to IBrokers. I have been looking around, and played with backtests in quantstrat and with sending orders from R to IBrokers, but I do…
1
vote
1 answer

Order id placeorder Java interactive brokers

Currently each time I place an order with order.m_action = "BUY"; order.m_totalQuantity = 1; order.m_lmtPrice = 4.00; order.m_orderType = "LMT"; order.m_account = "U123123"; int randomNum = ThreadLocalRandom.current().nextInt(1, 5564 + 1) …
PlacePrint App
  • 101
  • 1
  • 12
1
vote
1 answer

Currency (FX) order with IBrokers in TWS

I am able to use IBrokers to submit standard futures and equity orders through the API. When I try the same methodology for spot FX, I don't receive an error message, yet the order doesn't come through the TWS working window as it does with the…
theGreatKatzul
  • 437
  • 1
  • 5
  • 16
1
vote
1 answer

IBrokers R - paper trading account orders

Is it possible to process trades to a paper account through the IBrokers package?
milkmotel
  • 402
  • 4
  • 13
1
vote
1 answer

IBrokers error message (354 Requested market data is not subscribed.AAPL NASDAQ.NMS/TOP/ALL )

I try to connect TWS(A trading application of Interactive Broker) with a testing script in R. library (IBrokers) tws <- twsConnect() aapl.csv <- file("AAPL.csv", open="w") reqMktData (tws, twsSTK("AAPL"), eventWrapper = eWrapper.MktData.CSV(1), file…
madeinQuant
  • 1,721
  • 1
  • 18
  • 29
1
vote
2 answers

R IBrokers reqOpenOrders hangs

Would anyone be able to advise how to use R IBrokers reqOpenOrders properly? > tws=twsConnect(clientId=66,host='localhost',port='7497') > reqOpenOrders(twsconn=tws) TWS Message: 2 -1 2104 Market data farm connection is OK:usopt TWS…
valuenaut
  • 303
  • 2
  • 4
  • 13
1
vote
1 answer

reqHistoricalData() returning empty value using IBpy?

I am trying to use IBpy to return historical data from some instruments, but when I try the code in the documentation I get an empty result. I managed to make it work using R Ibroker but I would really prefer to have it working using the Python…
JordanBelf
  • 3,208
  • 9
  • 47
  • 80
1
vote
1 answer

ibrokers R - Financial Advisor - order placement

I'm trying to place an OCO order on a Financial advisor account using ibrokers and R. How do I place an OCO order? How could I include a stop and take profit with each leg of the OCO that's also cancelled? Thanks for any guidance! Sample…