Questions tagged [interactive-brokers]

A popular electronic trading platform, supporting API through Java, C++, C#, VB, Python 3, and Excel.

A popular electronic trading platform, supporting API through Java, C++, C#, VB, Python 3, and Excel. Unofficial implementations include ibrokers for R and ibpy for Python 2.

Useful links

426 questions
3
votes
0 answers

Need to use ib.sleep() to send multiple orders using ib_insync

I am having some strange behavior while sending orders to interactive brokers. Consider this code: from ib_insync import * import time ib = IB() client_id = int(time.time()) # gets second since epoch. No need for the milliseconds, so round to…
mks212
  • 901
  • 1
  • 18
  • 40
3
votes
1 answer

Running interactive brokers client portal API in cloud server

I am using client portal web API to get historical stocks and indices price data from IBKR. In the cloud server, I am running Ubuntu 18.04 and java runtime environment has been configured. Java version is higher than the minimum requirement. So I…
Chowon
  • 53
  • 1
  • 8
3
votes
5 answers

How to eliminate (or suppress from console) Interactive Brokers error when downloading data with Python API

I wrote the code below to read information from my accounts at Interactive Brokers: # Interactive Brokers functions to import data def read_positions(): #read all accounts positions and return DataFrame with information from ibapi.client…
Rational-IM
  • 2,353
  • 1
  • 9
  • 25
3
votes
1 answer

How to get historical stock price data from interactive brokers API?

I want to use IBAPI to get historical stock data. My code does not work and returns nothings. Can anybody help me edit the code? Thanks from ibapi import client from ibapi import wrapper import datetime from ibapi.contract import Contract from…
Yuan
  • 462
  • 4
  • 12
3
votes
0 answers

ibridgepy ImportError: dynamic module does not define module export function (PyInit_IBCpp)

Starting to play with ibridgepy and run into the follow exception following the tutorial: runfile('/Users/JohnDoe/Documents/IBridgePy_Mac/RUN_ME.py', wdir='/Users/JohnDoe/Documents/IBridgePy_Mac') Reloaded modules: IBridgePy Traceback (most recent…
user1452494
  • 1,145
  • 5
  • 18
  • 40
3
votes
1 answer

IB Gateway run as service

Is it possible to run an IB (Interactive Brokers) Gateway as a Windows service? I would like to operate a 7/24 solution without the need to log on the OS.
Pavel
  • 362
  • 4
  • 13
3
votes
2 answers

Interactive Brokers orders synched in both Gateway and TWS?

I have looked at this query Interactive Brokers API: Trader Workstation (TWS) vs IB Gateway It does not answer my question of: If I push an order through IB's gateway, will I be able to see the same open order position within TWS? This is of course…
Bryan Downing
  • 207
  • 2
  • 14
3
votes
1 answer

Get list of future contracts from Interactive Brokers

How can I use Matlab to get a list of a particular future symbol's individual contracts (in terms of expiration dates) from Interactive Broker's API? For instance, by providing the contract symbol for "ES" I would want a list of the contracts IB has…
MikeD
  • 171
  • 2
  • 13
3
votes
1 answer

Interactive Brokers - Free Trial - Error Code 354 - Requested market data is not subscribed

After running the following code: //IB's main object var ibClient = new EWrapperExt(this); //Connect ibClient.ClientSocket.eConnect("127.0.0.1", 7496, 0); var contractAAPL = new Contract { Symbol = "AAPL", SecType = "STK", Currency =…
ADH
  • 2,971
  • 6
  • 34
  • 53
3
votes
6 answers

call private void from another private void in C#

I would like to call btnSubmit if certain conditions in axTws1_tickPrice are true. How do i do this? private void btnSubmit_Click(object sender, EventArgs e) { //code here } private void axTws1_tickPrice(object sender,…
user4891693
  • 35
  • 1
  • 2
  • 5
3
votes
3 answers

Issues reading minTick from Interactive Brokers Java API

I am having some issues with Interactive Brokers API: when I request the contract details by using m_controller.reqContractDetails(contract, t); I receive the data; within it is contained the field minTick, which seems to consistently show…
autronix
  • 2,885
  • 2
  • 22
  • 28
3
votes
1 answer

Placing orders without transmitting them with IBpy?

I am new to IBpy and I am wondering if there is any way to place an order without transmitting it and waiting for a human input to actually transmit the order? I am using placeOrder to place orders but I can't find a way of placing them without…
JordanBelf
  • 3,208
  • 9
  • 47
  • 80
2
votes
1 answer

Fail to draw historical data from TWS API

def get_IB_historical_data(self, ibcontract, tickerid, durationStr, barSizeSetting): historic_data_queue = finishableQueue(self.init_historicprices(tickerid)) self.reqHistoricalData( tickerid, # tickerId, ibcontract, #…
2
votes
1 answer

IB TWS API C# foreach symbol get Level II

I try to get Level II for list of symbols: IBApi.Contract contract = new IBApi.Contract(); List mktDataOptions = new List(); int Ticker = 1; foreach (var line in File.ReadLines(textBox1.Text)) { contract.Symbol…
Marc Jone
  • 23
  • 2
2
votes
2 answers

Example of how to avoid duplicate order ids and corrupt prints in a multithreaded app thanks to queues with IB TWS Python API

My trading app written with Python and using the IB TWS API is multithreaded and I'm looking to solve once and for all the issues of corrupt prints and duplicate order ids, both of which can happen once multiple threads are running at the same…
Lianji
  • 23
  • 5