All Projects → rediar → Interactivebrokers Algo System

rediar / Interactivebrokers Algo System

Licence: apache-2.0
Java/MySQL live algorithmic trading using Interactive Brokers API

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Interactivebrokers Algo System

AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+50.33%)
Mutual labels:  finance, trading, trading-strategies, quantitative-trading
Strategems.jl
Quantitative systematic trading strategy development and backtesting in Julia
Stars: ✭ 106 (-29.8%)
Mutual labels:  trading, finance, trading-strategies, quantitative-trading
Tradingstrategies
Algorithmic trading strategies
Stars: ✭ 120 (-20.53%)
Mutual labels:  trading, finance, trading-strategies, quantitative-trading
Machine Learning And Ai In Trading
Applying Machine Learning and AI Algorithms applied to Trading for better performance and low Std.
Stars: ✭ 258 (+70.86%)
Mutual labels:  trading, finance, trading-strategies, quantitative-trading
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (-12.58%)
Mutual labels:  trading, finance, trading-strategies, quantitative-trading
Quant
Codera Quant is a Java framework for algorithmic trading strategies development, execution and backtesting via Interactive Brokers TWS API or other brokers API
Stars: ✭ 104 (-31.13%)
Mutual labels:  trading, trading-strategies, quantitative-trading
trading sim
📈📆 Backtest trading strategies concurrently using historical chart data from various financial exchanges.
Stars: ✭ 21 (-86.09%)
Mutual labels:  finance, trading, trading-strategies
Machine Learning For Trading
Code for Machine Learning for Algorithmic Trading, 2nd edition.
Stars: ✭ 4,979 (+3197.35%)
Mutual labels:  trading, finance, trading-strategies
Stocksharp
Algorithmic trading and quantitative trading open source platform to develop trading robots (stock markets, forex, crypto, bitcoins, and options).
Stars: ✭ 4,601 (+2947.02%)
Mutual labels:  trading, finance, trading-strategies
futu algo
Futu Algorithmic Trading Solution (Python) 基於富途OpenAPI所開發量化交易程序
Stars: ✭ 143 (-5.3%)
Mutual labels:  finance, trading, trading-strategies
Awesome Algorithmic Trading
A curated list of awesome algorithmic trading frameworks, libraries, software and resources
Stars: ✭ 328 (+117.22%)
Mutual labels:  trading, trading-strategies, quantitative-trading
Quantdom
Python-based framework for backtesting trading strategies & analyzing financial markets [GUI ]
Stars: ✭ 449 (+197.35%)
Mutual labels:  trading, finance, trading-strategies
piker
#nontina, #paperhands,, #pwnzebotz, #tradezbyguille
Stars: ✭ 63 (-58.28%)
Mutual labels:  finance, trading, quantitative-trading
Grademark
An API for backtesting trading strategies in JavaScript and TypeScript.
Stars: ✭ 140 (-7.28%)
Mutual labels:  trading, trading-strategies, quantitative-trading
Lean
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
Stars: ✭ 5,675 (+3658.28%)
Mutual labels:  finance, trading-strategies, trading
Awesome Quant
A curated list of insanely awesome libraries, packages and resources for Quants (Quantitative Finance)
Stars: ✭ 8,205 (+5333.77%)
Mutual labels:  finance, trading-strategies, quantitative-trading
Ta Rs
Technical analysis library for Rust language
Stars: ✭ 248 (+64.24%)
Mutual labels:  trading, finance, trading-strategies
roq-samples
How to use the Roq C++20 API for Live Cryptocurrency Algorithmic and High-Frequency Trading as well as for Back-Testing and Historical Simulation
Stars: ✭ 119 (-21.19%)
Mutual labels:  trading, low-latency, trading-strategies
Introneuralnetworks
Introducing neural networks to predict stock prices
Stars: ✭ 486 (+221.85%)
Mutual labels:  trading, finance, trading-strategies
Sgx Full Orderbook Tick Data Trading Strategy
Providing the solutions for high-frequency trading (HFT) strategies using data science approaches (Machine Learning) on Full Orderbook Tick Data.
Stars: ✭ 733 (+385.43%)
Mutual labels:  trading, trading-strategies, quantitative-trading

InteractiveBrokers-Algo-System

This Java/MySQL framework implements the Interactive Brokers API for algorithmic trading. Included are all essential components to support a basic trading execution system: live price feed, handling for IB price quote limits, order tracking system, margin tracking system, handling for order submission and execution, option chain information request, and kill switches. A system based on this framework, with additional custom modules and proprietary strategies is currently being used to profitably trade US equities and equity options

  • Requires either TWS or IB Gateway (desktop applications provided by IB) and IB Java API 9.71 (API library package). The API scripts initiate a live socket connection to the desktop TWS and IB Gateway application, which routes requests
  • Requires US Securities Snapshot and Futures Value Bundle ($10/month), US Equity and Options Add-On Streaming Bundle ($4.95/month) for live price feed. If solely using the framework for executing orders, then these add on costs are not necessary; it is possible to use another data source for live price feeds such as IEX, which is free
  • It's recommended to simultaneously run price feed and solely reading processes on an IB Gateway paper trading instance (port 4002 in the example) and trade execution/other writing processes on a TWS instance (port 7496 in the example)
  • API function documentation: http://interactivebrokers.github.io/tws-api/ Flowchart

Setup instructions

Set up MySQL database

Set up the following tables:

Price:

  • IBAlgoSystem.price: symbol (VARCHAR(10)), secType (VARCHAR(10)), currency (VARCHAR(3)), expiry (VARCHAR(8)), strike (DOUBLE), callorput (VARCHAR(1)), multiplier (VARCHAR(10)), bid (DOUBLE), ask (DOUBLE), last (DOUBLE), close (DOUBLE), bugCounter (INT), updateTime (BIGINT)

Option details:

  • IBAlgoSystem.MasterChainList: entry (INT), active (VARCHAR(1)), symbol (VARCHAR(10)), secType (VARCHAR(10)), exchange (VARCHAR(20)), currency (VARCHAR(3)), expiry (VARCHAR(8)), strike (DOUBLE), callorput (VARCHAR(1)), multiplier (VARCHAR(10)), pennyPilot (VARCHAR(1)), moneyness (VARCHAR(3))

Orders:

  • IBAlgoSystem.orderTracking: orderID (INT), status (VARCHAR(20)), filled (INT), remaining (INT), avgFillPrice (DOUBLE)

Execution failure retry counter:

  • IBAlgoSystem.counter: counterID (INT)

Cash, margin and risk balance:

  • IBAlgoSystem.margin: AccruedCash (DOUBLE), AvailableFunds (DOUBLE), BuyingPower (DOUBLE), Cushion (DOUBLE), EquityWithLoanValue (DOUBLE), ExcessLiquidity (DOUBLE), FullAvailableFunds (DOUBLE), FullExcessLiquidity (DOUBLE), FullInitMarginReq (DOUBLE), FullMaintMarginReq (DOUBLE), GrossPositionValue (DOUBLE), InitMarginReq (DOUBLE), LookAheadAvailableFunds (DOUBLE), LookAheadExcessLiquidity (DOUBLE), LookAheadInitMarginReq (DOUBLE), LookAheadMaintMarginReq (DOUBLE), LookAheadNextChange (DOUBLE), MaintMarginReq (DOUBLE), NetLiquidation (DOUBLE), TotalCashValue (DOUBLE)

Module descriptions

SimplePriceFeed

Read in TickerList.csv - a presaved list of contracts to receive live price feeds from. Here, a contract is defined as either a specific option, or stock

  • TickerList.csv fields: Active (T/F) | symbol | secType | exchange | currency | expiry | strike | right | multiplier
  • Output prices to the IBAlgoSystem.price MySQL table

LargePriceFeed

Read in IBAlgoSystem.MasterChainList - a list of options contracts to receive live price feeds from

  • The number of entries may exceed IB's feed limit (FEED_LIMIT). In that case, this script divides the entries into smaller batches to submit to IB
  • Output prices to IBAlgoSystem.price MySQL table

FetchOptionsChain

Read in TickerList.csv, a presaved list of contracts to receive live price feeds from. Here, a contract is defined as either a specific option, or stock

  • TickerList.csv fields: Active (T/F) | symbol | secType | exchange | currency | expiry | strike | right | multiplier Read in PennyPilot.csv, a presaved list of Penny Pilot tickers
  • Output option chain to IBAlgoSystem.MasterChainList MySQL table

TradeStrategy

Template to implement trade strategies - call price feed, submit order execution requests, manage orders and risk

  • Output order management to IBAlgoSystem.orderTracking MySQL table
  • Output margin management to IBAlgoSystem.margin MySQL table

KillSwitch

Kills all active orders

Simple walkthrough description

Receive price feed

  1. Start an IB Gateway instance on port 4002 (or custom defined port number)
  2. Define the contracts to receive stock and/or option price feeds for in TickerList.csv
  3. Execute SimplePriceFeed to start price feeds for contracts in TickerList.csv
  4. If TickerList.csv contains only stock tickers, execute FetchOptionsChain to generate the option chain for those tickers
  5. Execute LargePriceFeed to start price feeds for option chains
  6. Restart SimplePriceFeed or LargePriceFeed if problems occur

Execute trade strategy

  1. Start a TWS instance on port 7496 (or custom defined port number)
  2. Execute TradeStrategy

Trigger KillSwitch

In event of emergency only:

  1. Terminate TradeStrategy
  2. Execute KillSwitch to remove outstanding orders

Note the KillSwith does not impact SimplePriceFeed or LargePriceFeed (price feed)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].