Questions tagged [ib-api]

Interactive Brokers Application Program Interface (API) to build customized automated rules-based trading application.

Details are found here;

https://www.interactivebrokers.com/en/index.php?f=5041

93 questions
2
votes
1 answer

How to install and use IB API within Colab?

I am creating a notebook on Google Colab to run trading algorithms which execute on Interactive Brokers (IB). I want to use the IB API for this. My current code downloads and installs the API: # Install IB and related libraries !wget -cq…
AM Delhez
  • 51
  • 4
2
votes
1 answer

How to get real-time steaming data from IBapi for Python?

I am new to IBapi and Python and now just trying to write a program to get the real-time steaming market data from the IBapi continuosly. When I run the code, the data tick did come in for a while like few second. Then it will stop itself with…
LoK
  • 99
  • 1
  • 7
1
vote
1 answer

Couldn't connect to TWS

I can't connect to TWS. I've confirmed that "Enable ActiveX and Socket EClients" is enabled and connection port is the same as "Socket Port" on the TWS. import ibapi from ibapi.client import EClient from ibapi.wrapper import EWrapper class…
1
vote
1 answer

IBAPI get historical bars continuously

I'm new in programming, sorry if somwhere make simplemistakes or do not get something. I try to use IBApi for build script. Main point - request historical data continuously(one time in 15 sec for last week timerange, as example), convert it to…
1
vote
0 answers

Error Connecting to IB using ibapi python

I have been running IB Gateway client on my localhost. I need to use some basic apis like account details order execution and view orders. But When I use ibapi as python wrapper around IB APIs, it gives me an error >>> from ibapi.client import…
akshay parkar
  • 85
  • 1
  • 12
1
vote
1 answer

Trying to get historical data for multiple securities using python and IB API - df not clearing between loops

I'm trying to get historical data for several products through the IB API, and store each product in a dataframe (which I need to save in separate csv files). This is my code, the main issue is that the dataframe isn't clearing between loops, when…
limeyfred
  • 11
  • 2
1
vote
1 answer

How to automatically cancel an order if it is not filled after a minute?

I want to automatically cancel orders in IBKR's IB API if they are not filled after a minute. They are parent orders, so I can't just use cancelOrder after sleeping for 60 seconds or the child order will also be cancelled.
1
vote
1 answer

Export contractDetails to df or csv from TWS API in Python?

This question has actually already been asked and answered on another forum, howwwever, the answer was given through a web link and it appears as if that link has indeed expired. Thus I am forced to ask the question again to you lovely intelligent…
MANI
  • 23
  • 4
1
vote
1 answer

How to use class method parameter (?) as input in code (IBKR / IB API / IB TWS) - Python

(sorry if the terminology/explanation isn't right) I want to print "My account balance in USD is: xxx". The purpose is to understand how to use the class method parameter (not sure if this is the right terminology) as a code input However, the…
1
vote
1 answer

Problem with IB Insync Futures Order on Interactive Brokers TWS API

I am hoping somebody here may be able to help clarify how to structure the IB-Insync Contract Format for a Futures order in a python API link with Interactive Brokers API. I am trying to develop a autobot API link into the Interactive Brokers API…
Trent
  • 43
  • 1
  • 5
1
vote
0 answers

How to show buy order in trader station by native API

from ibapi.client import EClient from ibapi.wrapper import EWrapper from ibapi.contract import Contract from ibapi.order import * import threading import time class IBapi(EWrapper, EClient): def __init__(self): EClient.__init__(self,…
sys cheng
  • 39
  • 1
  • 10
1
vote
1 answer

interactive brokers api python - pull bid/ask trading book vendor

I'm using the IB API in order to automatically pull real time data of the full daily bid/ask trading book vendor. I am unable to figure out how to print on the screen this data yet, would appreciate some enlightenment Here is my code sample for…
1
vote
0 answers

How can I get all the stocks of each accounts in Interactive Broker IB API?

I have a Master Account which manages multiple accounts. How can I get the portfolio of each accounts? I've been trying the self.reqPositions() but it returns just the accounts with recent trades. for example I have 3 accounts and the I have…
1
vote
1 answer

Interactive Brokers Python Multiple Symbol Request

I was able to piece together a script from IB's documentation/examples and forums on this site. I am getting the output I want for a single symbol, however, if I use a list of stocks, I cannot figure out a way to pass the ticker symbol through to…
John
  • 479
  • 8
  • 21
1
vote
1 answer

Getting order Id error when running Ibapi / TWS API script

I'm running a test code that is supposed to place a simple order only, but every time I run it I'm getting a weird error that I've never experienced before. Here is a screenshot https://i.stack.imgur.com/cgL3b.jpg. And this is my script: Help would…