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
1
vote
1 answer

How to get the price your market order was filled at using IBapi?

I'm working on a test algorithm using IBapi with python (IBKR native API). How can I get the prices my market orders were filled at? I looked into the official documentation but it was hard to understand. I would be so grateful if you could help me.
1
vote
1 answer

How to return values from historicalData in TWS API Python

from ibapi.client import EClient from ibapi.wrapper import EWrapper from ibapi.contract import Contract from threading import Timer class TestApp(EWrapper, EClient): def __init__(self): EClient.__init__(self, self) def error(self,…
1
vote
0 answers

When using ibkr TWS, why does my code work the first time then stops unless I restart TWS?

Just learning to use IBPY for now. It seems like every time I run my code the first time everything works fine, but then if I try to run it again the console goes completely silent. The fix I'm using currently is just to restart TWS which works…
1
vote
1 answer

How can i avoid to get OSError: [Errno 9] Bad file descriptor using ibapi?

In the following code i am collecting data to pandas dataframe called ohlcv as a function and running the app throw to the ib server: from ibapi.client import EClient from ibapi.wrapper import EWrapper from ibapi.contract import Contract from…
Keyvan Tajbakhsh
  • 103
  • 1
  • 10
1
vote
0 answers

How can I know I retrieved data from ib_api reqMktData?

I am new to Python and started playing around with the Interactive Brokers API. I have a portfolio of options in my paper account and would like to retrieve the risks associated with each instrument. I started with just a single option contract…
Hotone
  • 431
  • 3
  • 18
1
vote
2 answers

No security definition has been found for the request, Future Option Python

I'm using Python and ib_insync to use the Interactive brokers API, I'm trying to get market data as Bid, Ask,AskSize etc of a future Options contract, but when convert this contract on a ticker I got "No security definition has been found for the…
Luis Carcamo
  • 31
  • 1
  • 3
1
vote
2 answers

How to obtain Contract Details from the Interactive Brokers API?

Following the Interactive Brokers documentation I am trying to obtain the contract details using the below code: from ibapi.client import EClient from ibapi.wrapper import EWrapper class MyWrapper(EWrapper): def contractDetails(self, reqId,…
Greg
  • 8,175
  • 16
  • 72
  • 125
1
vote
0 answers

The graph shows nothing

Here I have a code for getting data from IB API. When I try to compile it, it has no errors in Pycharm, but, the graph shows nothing and I get one (the last) strange error while working with IB API. Can someone explain me why does it happen? And…
Philip
  • 133
  • 4
1
vote
2 answers

IB API order placement error: cannot set VOL attribute on non-vol order

I'm trying to use a Go port of the ib API to connect to my Interactive Brokers Trader Workstation. I can connect and read data from the API but when I try to place an order on a paper trading account I get the following error: &{1 321 Error…
Johan Wikström
  • 4,033
  • 4
  • 28
  • 31
1
vote
4 answers

Encounter error "IB API required" when IB API is installed

I am trying out this new python package ib_insync. https://github.com/erdewit/ib_insync I ran the python script below; from ib_insync import * ib = IB() ib.connect('127.0.0.1', 7496, clientId=1) contract = Forex('EURUSD') bars =…
user1315789
  • 3,069
  • 6
  • 18
  • 41
0
votes
1 answer

How to obtain option chain data from Interactive Brokers TWS API

I am trying to build option chain data much like the major exchanges present it on their websites IE: Sort by expiration dates, then strike prices and display the bids/asks for the puts/calls etc. I am trying to get the data but have only been able…
Pearl
  • 392
  • 2
  • 12
0
votes
1 answer

I can't place an order on IBapi through TWS

I am writing a service to work through the TWS API based on the Python language. Faced a problem when placing an order. these code are which I'm using, and always it says waiting for connection waiting for connection waiting for connection waiting…
K H
  • 31
  • 2
0
votes
1 answer

Interactive Brokers API not storing historical price data into xlsx, how to resolve?

I want to distinguish the historical price data for e-mini S&P500 (ES) by RTH and ETH sessions and store them into xlsx files. The xlsx files are only showing 1 row containing: "Date, Open, High, Low, Close" without the historical price data. I am…
treewolf
  • 1
  • 1
0
votes
1 answer

Interactive Brokers TWS API: problems with getting futures prices via app.reqMktData

I've created a working piece of code which gets real time futures prices from IB TWS based on this topic https://quant.stackexchange.com/questions/55569/interactive-broker-api-error-321 It works for futures MNQU3 (this is Nasdaq-100 Index from the…
Andrei A
  • 3
  • 2
0
votes
1 answer

Why does TWS API recognize combo as 'OPT' not 'BAG'

I've successfully submitted a combo order (iron condor) through the IB API as security type 'BAG'. But when I try to retrieve the position through reqPositions, it is recognized as 'OPT' not 'BAG' and I can only see the strike of one of the…
Chris
  • 1