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

Interactive Brokers API: Trader Workstation (TWS) vs IB Gateway

In https://www.interactivebrokers.com/en/index.php?f=5041&ns=T it is written that in order to use the IB api you have to connect to it through the TWS or IB Gateway. Our API requires connectivity via Trader Workstation (TWS) or IB Gateway. What is…
Amio.io
  • 20,677
  • 15
  • 82
  • 117
14
votes
1 answer

How to enable TWS delayed market data?

Here is a script I am using to request market data. I am not subscribed to the data-feed yet, so I though it would automatically return delayed market data, but apparently I have to enable it, but cannot find where to do that. Here is the script and…
TB1
  • 269
  • 2
  • 5
  • 10
11
votes
4 answers

How do I get my accounts' positions at Interactive Brokers using Python API?

EDITED: I found a solution regarding the error messages - it was a bug on IB's API. The code I show as an answer below should be useful for those looking for a clean solution to read positions, and also NAVs, from their accounts at IB. The original…
Rational-IM
  • 2,353
  • 1
  • 9
  • 25
11
votes
3 answers

Connecting to Interactive Brokers API via Python

I am looking to connect Python to the Interactive Brokers API. A google search reveals the availability of ibPy (see https://pypi.python.org/pypi/ib) however it appears this library is not maintained nor does it support Python 3. I also found…
user1478046
10
votes
7 answers

Interactive Brokers, how to get a consumer key from registration API?

I'm trying to create a web server that allow users to oauth their IB accounts. To obtain a request token, you first need to get a consumer key. I tried to follow their instruction, but there is no details on how to make a call to get the…
Yumiko
  • 448
  • 5
  • 16
9
votes
3 answers

Getting parameters of listed options & futures in Interactive Brokers API

There are a lot of examples showing how to get particular asset's price from Interactive Brokers. However, when I want to get the whole chain of options for one asset, I don't know which particular strikes are listed. Same for futures, I don't know…
sashkello
  • 17,306
  • 24
  • 81
  • 109
9
votes
7 answers

TWS Interactive Brokers API - How to fix "No security definition has been found for the request"?

Using the Java API (and I guess this goes for any other TWS Interactive Brokers client API) I get an error "No security definition has been found for the request" The FAQ and other resources were resoundingly unhelpful. Contract contract = new…
FlavorScape
  • 13,301
  • 12
  • 75
  • 117
8
votes
9 answers

How to properly uninstall TWS (Trader Workstation) by Interactive Brokers from Ubuntu?

I guess everything is in the title. They do have an installation shell script but nothing else. I was looking for any other scripts or, maybe, some CLI flags to make it perform an uninstall but couldn't find any. How does one properly uninstall this…
8
votes
1 answer

ibpy: extract API responses for multiple contracts

I am interested in using ibpy with Interactive Brokers API to get real time tick data for a given universe of 100 stocks. The code below, from examples on the web works for one stock. Can someone tell me how i can do this for 100 stocks at the…
john wouters
  • 91
  • 1
  • 5
7
votes
3 answers

Interactive Brokers Symbol list

I want to use the IB Api, but cannot figure our how the request a complete symbol list and information. In the Documentation i found: reqScannerParameters() - but it is not clear how to get a list for example of nasdaq stocks ? Is there a better way…
Roby
  • 2,011
  • 4
  • 28
  • 55
6
votes
5 answers

403 response code for any POST request to Interactive Brokers Client Portal Web API

I try use Interactive Brokers Client Portal Web API: I succesfully start gateway and login. I succesfully make GET requests to various end-points. When I make POST request to any end-points, I receive 403 response code. For example, I try update…
6
votes
1 answer

IBPY get correct historical volume data

I am trying to get historical data from IBPY. I get it, but the volume is extremely low to the point it's useless. I would like to know how to get the correct historical volume estimation. I'm executing the following code: from ib.opt import…
Ilans
  • 95
  • 6
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…
6
votes
3 answers

Can you perform backtests on Interactive Brokers?

I have started using IB in combination with IBridgePy and I was wondering whether it is possible to somehow perform any backtests, does anyone how to do this?
Ade Bijon
  • 85
  • 1
  • 1
  • 4
6
votes
1 answer

Getting Multiple Last Price Quotes from Interactive Brokers's API

I have a question regarding the Python API of Interactive Brokers. Can multiple asset and stock contracts be passed into reqMktData() function and obtain the last prices? (I can set the snapshots = TRUE in reqMktData to get the last price. You can…
1
2 3
28 29