
Explain why an advanced IB API course is needed for its comprehensive, complex concepts left out of the introductory course, including basic IB API classes, order object, and contract object.
Compare pros and cons of the ib api, including market access, data costs, and no api charges with the pro plan. Consider latency from limited servers and the learning curve.
Learn that IB API centers on two classes, the client class Ekland and the Erap, connecting to TWS, requesting data, and placing orders, with Erap translating WS output for humans.
Learn to debug IB API errors from function signature changes by checking docs and wrapper.py, updating error calls with new arguments, and locating source code in site-packages or installed paths.
Learn the basic code architecture for a TWX API trading app by importing Ekland and Grappler, defining a class inheriting from Eruptor and Ekland, and configuring the websocket connection.
Move the WebSocket connection to a separate thread using multithreading to prevent the master thread from blocking and enable simultaneous execution of trading strategies.
Explore Interactive Brokers' scanners to fetch top gainers and losers, apply filters for market cap, volume, and price, and run scans across the US and Indian markets.
Backtest trading strategies on historical data for a single ticker, with configurable candles and defaults for cost, slippage, risk per trade, stop loss, and take profit.
Explore parallel programming as a way to implement sophisticated strategies on the IBIS platform, contrasting it with sequential programming and independent tasks via a noodle example.
Learn how to implement multithreading in Python to stream random integers, identify the first 10 values above 100 divisible by five, and store unique results for display across threads.
Learn to stop multithreaded Python tasks when objective, first 10 integers greater than 100 and divisible by five, is reached, avoiding infinite loops with a WebSocket example and demon threads.
Explore how to gracefully close threads in Python using the daemon thread approach and the event module, showing when to set flags and how to stop loops safely.
Learn to use multithreading to stream real-time prices and feed them into strategies, coordinating three threads: trading app, WebSocket input, and text stream that update a shared latest price variable.
Implement live price streaming with the IB Python API by updating a current price dictionary from market data and streaming tickers for US tech stocks via a WebSocket thread.
Explore building a historical data trading app using WebSocket data streams, handling candles by symbol and duration, converting data to frames, and addressing lag time in data retrieval.
Explore how to synchronize historical data extraction for multiple tickers with a conditional lag, ensuring all data is collected before building the data frame, and recognize this approach's pitfalls.
learn to extract historical data from a websocket stream by using the event module to wait for the last candle of each ticker, employing the historical data end function.
Recap of the IB API orders workflow: create contract and order objects, establish a WebSocket connection, and manage the next valid order id to place a limit order reliably.
Explore fetching open orders with the api using request all open orders to see active orders by client id, and learn that the execution api provides fill details.
Fetch executed orders using the IB API execution class and request executions, then apply an execution filter to retrieve details like execution id, time, price, and quantity.
Explore bracket orders by learning how a master order combines a take-profit and a stop-loss into a single multi-order, with parent and child orders transmitted together.
Learn to extract updated positions from the Interactive Brokers Python API, fix duplication by refreshing or updating the position data frame, and update position and average cost on the fly.
Learn to stream your account level PNL with the request BNL function, retrieving daily, unrealizable, and realizable PNL in real time, and compare streaming to data frame storage.
Learn to stream position level PnL by fetching a single position's daily PnL with the request BNL single, using contract details to identify the contract id.
Discover how Interactive Brokers market scanners, Mosaic Market Scanner, and Advanced Market Scanner identify in-play stocks by applying price, volume, market cap, and technical filters with dynamic real-time results.
Learn how to extract scanner parameters via the Interactive Brokers Python API, understand limits on results and concurrent scans, and generate the XML parameter file for stock filters.
Develop a market scanner using the IB API by configuring request scanner subscription and scanner data to fetch Nasdaq gap-up stock opportunities.
Open range breakout strategy uses first 15-minute range and volume spikes to trigger bracket trades with 5% take profit and stop loss at opposite range, one trade per ticker.
Demonstrate the open range breakout strategy by building contract and bracket order utilities, streaming last traded price, and fetching historical data to define high, low, and volume criteria.
Build an open range breakout function that aligns 15-minute data to 5-minute candles and computes average volume, then run an infinite threaded loop to manage orders and a killswitch.
Implement a kill switch to cancel all open orders, square off positions, and safely shut down, while coordinating data and strategy threads and market data for robust live trading.
Employ multi-threading to stream and refresh historical data for an open range breakout strategy. Use history data events and ticker events to synchronize threads and avoid duplicate candles.
Demonstrate an ORB strategy using the Interactive Brokers Python API to screen gap stocks, apply capitalization and gap filters, and place bracket orders with stop loss and take profit.
Automate the open range breakout homework by using the ws scanner to fetch stocks that gapped up or down the most, replacing manual ticker entry with scanner-driven updates.
Demonstrates solving the homework by storing tickers from the Nasdaq scanner in a global variable, and applying market cap, price, and open gap percentage filters to select gap up stocks.
Plan and execute backtesting for the open range breakout strategy by selecting a stock universe, choosing time horizons, extracting daily and intraday data, and modeling slippage.
Learn to extract daily data for a universe of stocks to backtest an open range breakout strategy with the Interactive Brokers Python API, including end-date handling and multi-ticker data coordination.
Identify daily gap stocks by comparing open prices to the prior close and calculating the gap percentage, then compute the previous five-day average volume for backtesting.
Develop a backtesting workflow with the Interactive Brokers Python API to compute daily returns from five-minute data, including take profit, stop loss, slippage; include error handling and KPI reporting.
Design and deploy advanced trading strategies on Interactive Broker's platform using parallel programming/multithreading concepts. Gain an edge in your trading by learning to harness advanced IBAPI functionalities and modules such as scanner, advanced orders etc.
You can expect to gain the following skills from this course
Applying Parallel programming concepts in API trading
Advanced order types
Harnessing streaming data (price, position, p&l)
Implementing scanner using IBAPI
Backtesting strategies
End to end design and deployment of advanced strategies
This course aims to provide a much deeper understanding of IBAPI features to beginner and intermediate level users of IBAPI. I have created this course based on the feedback received on my introductory IBAPI course from students who wanted to delve deeper and deploy advanced algorithms on IBAPI platform. This course seeks to provide you with the required tools to deploy any kind of strategy on Interactive Brokers platform and gain an edge by leveraging IBAPI's advanced functionalities.
The course covers and implements Open Range Breakout strategy which is quite complex to implement as it requires a number of tasks to be performed simultaneously (e.g. streaming current price of tickers, streaming PnL of tickers, extracting historical data periodically, performing calculations, generating signals and order management). The course explains how such strategies can be built step by step and how the various IBAPI tools can be used efficiently to ensure that the various parts of the strategy work harmoniously.