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
6
votes
2 answers

how to handle async error in ib_insync with python3.7?

Sorry I may ask a stupid question but I am just a beginner in python and algotrading. I am now using Python 3.7 and ibapi with ib_insync to try connect TWS. However, as Python 3.7 use async as a keyword so when I try to code with ib_insync: from…
5
votes
4 answers

installing the ibapi package

Hi I am trying to install ibapi in python however the package seems to be unavailable because there is an error every time I try to install it is there another way I can install this package . Your help will be greatly appreciated. I have left the…
4
votes
2 answers

Exception error in EReader thread running ibapi

I am running Python ib-api to receive the realtime market data from Interactive Brokers. It can provide the data I expected but it ends with "unhandled exception in EReader thread". from ibapi.client import EClient from ibapi.wrapper import…
Michael Siu
  • 41
  • 1
  • 3
4
votes
1 answer

Python IBAPI reqContractDetails won't return result when run second time

I want to request contract details and it worked the first time I run the code, but when I press run again, it won't return anything. It will work if I quit TWS and pycharm and try again I am new to python and don't understand how it works…
SkyBlue
  • 53
  • 1
  • 3
3
votes
2 answers

interactive brokers api python - fire order during "pre market"

I'm using the IB API in order to automatically fire orders during pre-market time. I am unable to figure out why the order is waiting for the market opening time instead of buying during the pre-market period. After looking at the API documentation…
3
votes
1 answer

Unable to connect python with TWS using ibapi

This is my code: from threading import Timer from ibapi.client import EClient from ibapi.wrapper import EWrapper from ibapi.contract import Contract from ibapi.order import * class TestApp(EWrapper, EClient): def __init__(self): …
ComputerBoi
  • 37
  • 1
  • 1
  • 7
3
votes
1 answer

Interactive Brokers API (IBAPI) - Using threading.Timer object to auto exit when the data connection is broken

I have been trying to implement a mechanism that request live data (such as reqRealTimeBars) and automatically make the script to exit in case the data connection is broken. I have been making test with the threading.Timer object…
jim jarnac
  • 4,804
  • 11
  • 51
  • 88
3
votes
1 answer

IB Api get list of symbols by passing exchange name

I am new to IB API and I want to fetch a list of symbols of a particular exchange type. So basically I will pass exchange/type and receive a list of symbols. I am not able to find out a relevant method. Please advice.
2
votes
1 answer

Capture Interactive Brokers Trade Execution details python

I can't figure out how to capture in a dataframe the executed trades with the execDetails function from https://interactivebrokers.github.io/tws-api/executions_commissions.html class TradingApp(EWrapper, EClient): def __init__(self): …
2
votes
1 answer

Why am I getting "ERROR 508 322 Error processing request.-'bW' : cause - Duplicate ticker id" in IB API / TWS (Python)

I'm trying to print the opening price of SPY (hence the tick of 14), similar to printing the account balance in USD. Printing the account balance worked prior to adding code trying to print the SPY price. However, I'm now getting "ERROR 508 322…
2
votes
2 answers

TWS interactive brokers API with Python. Trouble putting live data together when received by several methods methods

To give more context about my problem: I am using python to build an API connecting to the TWS of interactive brokers. I managed to build something functional and able to fetch live data from contracts using the methods given in the doc of IB. Now…
2
votes
1 answer

IB API: Checking if in trade or have open order

In the interactive brokers API, How do I check if there is already an open order or if I'm in a trade for a specific Contract in python. Can't seem to find an answer online Thanks a lot
2
votes
1 answer

ib_insync client - Peer closed connection

I am using the great package ib_insync for building a project with IB. I am getting some live ticker data as follows (pseudo code): await self._ib_instance.connectAsync(host=self._host, port=self._port, clientId=100, readonly=True) for contract in…
abe
  • 198
  • 2
  • 12
2
votes
1 answer

Futures data no permissions through reqHistoricalData but reqMktData works

Been stuck on this for a while. All future market data permissions are enabled on our account, however when I try request historical bar data for the current futures contract for MES I get Market Data Service error message:No market data permissions…
Tom
  • 1,235
  • 9
  • 22
2
votes
1 answer

What is @iswrapper decorator from ibapi.utils?

As the title suggests, what does @iswrapper decorator do? I see it quite often in the official docs, but can't find any explanation of it.
Biarys
  • 1,065
  • 1
  • 10
  • 22
1
2 3 4 5 6 7