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
0
votes
0 answers

Error reading request when retrieving tick data from Interactive Brokers API (Python)

I am trying to retrieve tick data from Interactive Brokers using the ib_insync library in Python. However, I'm encountering an error when making the request. Here's the code I'm using: from ib_insync import * import pandas as pd def main(): ib…
deltaone
  • 1
  • 1
0
votes
1 answer

How can I submit a pending order using ibapi that can be executed after hours as well?

I use Python to access abiapi.. order = Order() order.action = "BUY" # or "SELL" order.action = "SELL" order.totalQuantity = quantity # the quantity of the asset to buy/sell order.orderType = "LMT" # the order type, such…
Aftershock
  • 5,205
  • 4
  • 51
  • 64
0
votes
0 answers

Ran script with Spyder to send order to interactive brokers via IBAPI but no printing messages returned and no order sent to trader workstation

I tried to debug the script with "print" statements, couldnt find any issue but still nothing was printed.. appending my code for reference please, i have checked if the API was connected using app.run(), it somehow still seem stuck from…
Jun
  • 13
  • 4
0
votes
0 answers

I am attempting to organize live data coming in from IBs TWS API into a Pandas dataframe however I'm getting that some names not defined

from ibapi.client import EClient from ibapi.wrapper import EWrapper from ibapi.contract import Contract import matplotlib.pyplot as plt import pandas as pd import threading import time import datetime class IBapi(EWrapper, EClient): …
Scieoner
  • 11
  • 1
  • 6
0
votes
0 answers

i am trying to create a live candlestick chart with data from Intreractive Brokers TWS API, what am i doing wrong? I get the following error:

from ibapi.client import EClient from ibapi.wrapper import EWrapper from ibapi.contract import Contract import matplotlib.pyplot as plt import pandas as pd import threading import time class IBapi(EWrapper, EClient): def __init__(self): …
Scieoner
  • 11
  • 1
  • 6
0
votes
1 answer

IBKR IbApi connection does not drop / disconnect after receiving fundamentalData information

the connection never drops, I have tried pretty much everything or so I think: import xmltodict from ibapi.client import * from ibapi.wrapper import * import time import threading class IBapi(EWrapper, EClient): def __init__(self): …
Alex
  • 13
  • 3
0
votes
1 answer

Trouble getting ibapi to place trades

I am trying my hand at making my first algo-bot and decided to go with IB and use their api. I have followed Jacob Aramral's youtube series about making a bot and pretty much followed along and added tweaks along the way to make the logic performed…
LifeEdit
  • 3
  • 1
0
votes
0 answers

How to define functions in TWS API (ib-api) using Python to avoid code duplication?

I want to create multiple orders to close my positions at the end of trading session. Below is one of the orders. This code is repeated multiple times (with the number "1" just replaced with different numbers). Can someone please suggest how to code…
0
votes
0 answers

IBAPI how to get VWAP value

I am trying to develop a bot using the IBAPI. I was trying to figure out how to write python code to get VWAP value, but I want to be able to define from what time VWAP restarts calculating. Using the TA phython package, its VWAP function resets at…
0
votes
1 answer

TWS-API and ib_insync: Order Status is not updated properly

I'm trying to place an order using the TWS-API and the python package ib_insync. However, I recognize that the order status is not updated by TWS automatically. Please consider the following snippet: stock = Stock('BMW', 'SMART',…
0
votes
1 answer

Interactive Brokers API - Historical Account Summary

IBApi account summary request only pulls current account information. Is there a way to request historical account information? For example, historical net liquidation value to calculate the historical performance of the portfolio.
TG_01
  • 73
  • 8
0
votes
1 answer

IBapi - is there any way to get NIFTY50 index price quote

i am new to Interactive brokers API, wondering if there is any way to get quote of NIFTY50 index, as i can see examples of NIFTY FUTURES, etc but not on index price quote of NIFTY50 or BANKNIFTY, need help with some example, thanks, sample on on…
Maria628
  • 224
  • 3
  • 19
0
votes
0 answers

IB API - 'App' object has no attribute 'nextValidOderId'

I am a newbie and confused with the nextOrderId. In the testing code I have the following: order_id = self.nextValidOrderId print('order_id', order_id) next_order_id = self.nextOrderId() print('next_order_id', next_order_id) But the response…
alex-mon888
  • 51
  • 1
  • 7
0
votes
1 answer

Interactive brokers python API only trasnmiting a single order per app instance

I am building an app to place orders through the Python API an am having an issue with the consistency of order transmission where only one order can be received and executed per app instance. As an example if I run the below code it will execute…
Dodo
  • 55
  • 10
0
votes
0 answers

Why does my IBKR (Interactive Brokers) bot sometimes not receive data?

I have a bot for printing price data to csv format. Sometimes, no data has been added to the csv. This happens despite no error messages being printed in the terminal. I assume the problem is with the connection between my bot and IBKR since this…