Skip to main content

Questions tagged [interactive-brokers]

Questions about Interactive Brokers, a retail brokerage, and its API for automated trading.

Filter by
Sorted by
Tagged with
3 votes
1 answer
985 views

Getting incorrect options data with IB API. Missing real time market data subscription?

I'm having a problem getting options data with IB's API. The data seems not to be correct. In my code I'm getting some 0DTE call options for the Mini SP500 March Futures contract and printing their ...
rugobal's user avatar
  • 51
0 votes
2 answers
114 views

How do Personal Finance companies get access to their customers investment accounts? [closed]

I want to create an app that centralizes all the customer's investment accounts into one platform where they can view/monitor their trading positions across all brokerage accounts. How do apps like ...
Dean Azzawe's user avatar
0 votes
0 answers
175 views

Inaccurate real time data from stock broker

I use Interactive Brokers and have a subscription to their NASDAQ data. I use it to get near real-time data for the stock PLUG. I used to get streaming 5-sec bars and aggregate them into 1-min bars, ...
R M's user avatar
  • 11
0 votes
1 answer
125 views

How to lower intraday trading commisions [closed]

I’ve been running an algo in paper trading (on Interactive Brokers) that I would like to switch over to live. It makes anywhere between 20-40 trades a day, which racks up a lot of commissions. Any ...
R M's user avatar
  • 11
1 vote
0 answers
37 views

Better to "work order" or just give best limit price when placing multi-leg option orders through IB with SMART routing

I place option trades usually consisting of 2-4 legs...mostly ratios spreads through IB using the SMART routing algorithm. Say for a particular trade, the bid is 0.04 debit and the ask is 0.17 debit. ...
486DX2-66's user avatar
1 vote
1 answer
47 views

How much do brokerage apps cost versus traditional brokerages?

Apps like Robinhood and TD Ameritrade apparently don't adhere well to best price practices and instead are incentivized to widen the spread, adding cost to the trader in the form of what the trade ...
IDNeon's user avatar
  • 11
0 votes
0 answers
504 views

IB API - get data on position that close

I am trying to implement a few new features for my trading system. My plan for now is to initially buy the stocks i wants (using Vwap) and when the order has closed (bought all the quantity) I want to ...
Amir Ariely's user avatar
1 vote
0 answers
365 views

How to merge Trade ticks with Bid_Ask ticks from IB API reqHistoricalTicks, like the Time&Sales window?

reqHistoricalTicks returns data with 1 second precision, so only looking at timestamp is not enough to merge them. But it seems that the Time&Sales window in ...
davidtgq's user avatar
  • 111
4 votes
2 answers
2k views

Whats the need of Executing brokers if Prime brokers are the protagonist?

I am trying to read some literature on Prime Brokerage. In context of prime brokerage, primarily we have 4 participants Customer Executing Broker (EB) Prime Broker (PB) DTC (it could be specific to ...
userx's user avatar
  • 161
2 votes
1 answer
3k views

Interactive Broker API error 321?

Hi I'm having trouble with the Interactive Broker python API. I'm using python 3.8 and connecting to IB TWS ver. 979 when I run this symbol script I get the following error: ...
gearhead's user avatar
  • 123
0 votes
0 answers
110 views

Charting & Trading platform with 3rd party integration

so it's 2020 and I'm surprised that there don't seem to be any platforms that provide clear and easy integration with a 3rd party backend for indicator/signal generation, charting, trade execution, ...
Jed's user avatar
  • 101
1 vote
1 answer
155 views

how to calculate/retrieve the number of sell orders (and buys orders as well) to detect iceberg orders

As a manual trader, i could identify the iceberg orders because my interface provided me in real time the number of buys and the number of sells at best ask and best bid. For instance, when the ...
gilhop's user avatar
  • 31
1 vote
1 answer
841 views

Interactive Brokers: Is Flex Web Service with Paper Account possible?

I am testing an automated system each day and I want to pull daily trade reports. The Flex Query is perfect, and works with my Live Account, but I cannot figure out how to make it work with the Paper ...
sslack88's user avatar
  • 131
0 votes
1 answer
495 views

How to hedge PLN account on Interactive Brokers

I know that you can't have PLN account on IB, the PLN input is exchanged into USD, GBP etc. currency. However I would like to hedge the other currency exposure against PLN, or at least find out how to ...
Matěj Langr's user avatar
1 vote
2 answers
470 views

What exactly is a contract's "trading class"?

Web searches for this are drowned in pages offering trading courses, and the InteractiveBrokers API doesn't expand at all on the term. So what are contract trading classes, and what are some examples,...
Gascoyne's user avatar
  • 527
2 votes
1 answer
1k views

After hours data - Interactive Brokers

I just started using Interactive Brokers because of their API. I'm using the IBrokers package in R. I've managed to get data for S&P 500 and other indices but now I want data for S&P 500 after ...
Viðar Ingason's user avatar
4 votes
1 answer
4k views

How do I change the time zone in the interactive brokers API?

I am using the Interactive Brokers API, TWS release 974, with IBC and the ib_insync library. I would like to change the time zone inside one of these, in order to get market data and history according ...
Yuval F's user avatar
  • 141
0 votes
1 answer
892 views

Interactive brokers historical data availability

I'm considering Interactive Brokers because of the IBrokers package for R. On this site there is a small section on data availability and I'm having a hard time understanding the table. Lets say I ...
Viðar Ingason's user avatar
0 votes
1 answer
324 views

Keep Saved IB Historical Data Accurately Adjusted

How have you dealt with adjusting saved historical data, specifically using the IB API? As far as I can tell, currently, I need to perform the calculations described on Quandl's blog. I haven't ...
The AI Architect's user avatar
2 votes
0 answers
75 views

IBrokers: How to assign trail amount for order type 'TRAIL'?

I'm using R package IBrokers with IB TWS. I'm trying to create a twsOrder object using twsOrder function: twsOrder(...., orderType = 'TRAIL', ...) How can I ...
Deb's user avatar
  • 21
4 votes
2 answers
3k views

Market Making Strategy to Interact with IB API

I was thinking to connect a market making software to the Interactive Brokers API (see IB API), but it seems it is not the best solution as per the information provided by this question: Is the ...
user1050421's user avatar
1 vote
0 answers
141 views

How to Determine the Last Stock Price Before We Begin to Liquidate the Position on Interactive Brokers?

I do not if it is me who is wrong or Interactive Brokers' employees who do not provide a clear information by phone about How to Determine the Last Stock Price Before They Begin to Liquidate the ...
Ivan's user avatar
  • 123
2 votes
0 answers
109 views

What does leverage lower than 1 means for ETFs

I've recently noticed in my IB terminal that many ETFs have leverage lower than 1. I understand that some ETFs have leverage higher than 1 for example TQQQ because ...
Michael Dz's user avatar
4 votes
1 answer
5k views

Interactive Brokers - Tracking High Relative Trading Volume

I'm new to Interactive Brokers (and day trading), I am trying to setup my different charts etc. How can I have alerts/monitor for any stock that is trading at above average volume - compared to X? ...
Blundell's user avatar
  • 141
3 votes
1 answer
3k views

3rd party API like IBPy for Interactive Brokers python API?

I've read some tutorial of the Interactive Brokers API's TWS and it seems very low level and requires so much work just to place a simple market order. I've come across IBPy and just wondering how ...
Kevvy Kim's user avatar
  • 173
4 votes
1 answer
2k views

Interactive Brokers: Automating collection of client account position without TWS/IB Gateway

I'm trying to create a dashboard where I can show my clients their account positions, updated on a daily basis. I know IB offers the TWS/IB Gateway solution however I'm looking for a more lightweight ...
Jad S's user avatar
  • 141
2 votes
0 answers
371 views

Interative Brokers: using ibPy to get live market data

documentation on ibPy is sparse. All I would like to do is request the current price of a security both pre-market and during market hours so that I can make automated trading decision on that ...
user31172's user avatar
7 votes
1 answer
1k views

Efficient integration of tick data feed with signal generation

The goal is to design the integration of processes generating trading signal doing analytics on a stream of asynchronous tick data retrieved using the native Python TWS API of Interactive Brokers. Two ...
Elrond's user avatar
  • 390
3 votes
1 answer
2k views

Close and Adjusted Close in Interactive Brokers API and Yahoo Finance

On Interactive Broker's TWS API manual, there are several historical data types to choose from. Which IB TWS data type's Close value corresponds to Close Adjusted ...
Nyxynyx's user avatar
  • 129
0 votes
1 answer
142 views

Making an IB contract: Directory for IBpY exchanges and commodity codes?

All the tutorials for making a contract seem to use either Apple or Google as examples: goog_contract = create_contract('GOOG', 'STK', 'SMART', 'SMART', 'USD') If I want to trade CME Feeder Cattle ...
DaveW's user avatar
  • 1
2 votes
1 answer
2k views

Problems retrieving historical data through IbPy

I am having problems retrieving 14 days historical data from IB. I recently made the switch from MATLAB to Python so I have a lot of catching up to do. Where do I go wrong? All help is appreciated. ...
Bondeaux's user avatar
0 votes
0 answers
606 views

How can I export intraday stock data into CSV from Interactive Broker or Yahoo Finance?

Google Finance API seems to be down forever. Are there instructions or manuals for downloading intraday stock data into CSV files from Interactive Broker OR Yahoo Finance?
Kevvy Kim's user avatar
  • 173
0 votes
1 answer
920 views

How to request intra day real time option data using ibPY?

For example, price, iv, delta, gamma, volume, and open interest
kevin's user avatar
  • 1
0 votes
1 answer
211 views

What is the best way to connect R with IB?

I am looking to connect my trading models to trade in IB. my models are R based. what is the best (and fastest) way to create a system that get data from IB and based on this data create trades in IB. ...
alonch7's user avatar
  • 31
4 votes
2 answers
1k views

Changing timezones with historic forex data (Interactive Brokers API IBPy)

I would like to be able to change the timezone for my requests to the IB API, how can I do this? I am writing in Python, and thus use the IBPy wrapper found here. How to reproduce the problem: ...
lostlostlostlostlost's user avatar
2 votes
1 answer
508 views

How to get all securities in an asset class from IBPy (Interactive Brokers python API)

Would like to know how to request all securities in an asset class using IBpy, the python wrapper for the Interactive Brokers API. For example getting all currency pairs in the class forex ('CASH'), ...
lostlostlostlostlost's user avatar
4 votes
1 answer
870 views

Trader Workstation on Ubuntu cannot be connected to via the API [closed]

I am using ibPy to connect to TWS on a fairly fresh ubuntu machine. I have been successful in logging into the paper trading account and submitting buy and sell orders programatically via the ibPy ...
user3064222's user avatar
3 votes
1 answer
606 views

How to perform batch-trading using Interactive Broker API?

My definition of batch-trading: Given $N$ BUY orders, $M$ SELL orders and $O$ ($O < N$) as the max number of open positions to be held. Batch-trading should monitor the orders and when $O$ BUY ...
user2979010's user avatar
2 votes
1 answer
367 views

How to request current Interactive Broker positions using VBnet/Activex and the API?

I'm trying to use the reqPositions() method but it doesn't have an event handler associated with it that it references in the API.
Anthony's user avatar
  • 21
10 votes
2 answers
732 views

Are there any integrated framework that I can back-test and paper/live trading in one place?

I'm trying to start working on a fully automated algorithmic trading system, and I'm a little struggling with the framework to use. The requirements I have in my mind are: Needs to support back-...
Hao's user avatar
  • 313
2 votes
1 answer
1k views

Why does my ibpy connection always close automatically

my code: ...
user19883's user avatar
0 votes
1 answer
400 views

Extracting IB market data: bid and ask for greeks and IV

I wrote a piece of code to get option chains with volatility and greeks from IB market data. After testing yesteday, it seems to work, but I am surprised of seeing bid and ask for impliedVolatility ...
Roman Rdgz's user avatar
2 votes
0 answers
441 views

Downloading IB futures data and then making a datapump to another program

I never have programmed before in my life but I wouldn't mind learning if I knew what i needed to do in order to solve my problem. I use neuroshell for day trading and use it extensively for trading ...
user19145's user avatar
5 votes
1 answer
3k views

How to get historical data for expired futures contracts in IbPy?

Does anyone know how to request historical data for futures contracts that have already expired in IbPy? There are plenty of examples for requesting historical data for example this post, however ...
Peter H's user avatar
  • 211
2 votes
0 answers
83 views

How can the time value portion of an option be higher than 100%?

Here's a screenshot from InteractiveBrokers TWS for the near-the-money put and call on the ES Dec '15 Future: The absolute value of the time value, 9.50, makes sense. But why is the percentage value ...
Gascoyne's user avatar
  • 527
6 votes
2 answers
6k views

Send TRAIL STOP order when price hits a certain level, with IB TWS

Posting here after searching around and not finding any responses to basically the same question that I saw on EliteTrader, with another variant posted 10 years ago (update: the same question on Money)...
Gascoyne's user avatar
  • 527
1 vote
1 answer
621 views

Broker or source of intraday futures data for a python API?

I am looking for a broker that offers a python API for downloading historical intraday data on futures. So far I have only seen Interactive Brokers and Tradestation. Are there some other brokers ...
user1367204's user avatar
1 vote
2 answers
881 views

Aggregate interactive brokers data in matlab

I am using matlab and interactive brokers API. I am getting real time data using tickerID = ib.realtime({ct},'233',@(varargin)ibEventRealTimeData(varargin{:})); where ib is the interface to ...
user1000650's user avatar
2 votes
1 answer
7k views

IbPy download historical price data

How can i download historical price data from interactive brokers using IbPy and python?
Uninvited's user avatar
4 votes
2 answers
6k views

How to get positions of your portfolio from Interactive Brokers with python IBPy?

I am using IBPy to get the positions of my portfolio. I understand that I can do: ...
Escachator's user avatar