Trading model using Interactive Brokers API for high-frequency data studies
Top 18.0% on sourcepulse
This repository provides a Python-based high-frequency trading model that leverages the Interactive Brokers API for executing pairs and mean-reversion strategies. It is designed for traders and researchers interested in automating trades, exploring high-frequency data, and building algorithmic trading systems.
How It Works
The model employs statistical arbitrage techniques, including bootstrapping with historical data for parameter derivation, resampling time series for homogeneity, and identifying highly correlated tradable pairs. It supports shorting one instrument and longing another, using volatility ratios for trend detection, and calculating fair security valuation via beta. Trade signals are generated based on incoming tick data, with beta re-evaluation at configurable intervals.
Quick Start & Requirements
pip install -r requirements.txt
docker-compose.yml
with TWS host IP.Highlighted Details
ibpy
to ib_insync
library in version 3.0.Maintenance & Community
The project saw its last update in June 2019 (Version 3.0). The author also published a book, "Mastering Python for Finance - Second Edition," with related source codes available on GitHub.
Licensing & Compatibility
The repository does not explicitly state a license. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
The project is described as a work in progress, with version 2.0 noting many outdated components and the trading model being unlikely to work as intended. The included strategy parameters are theoretical and not adjusted for back-tested results. The model has only been tested in a demo account.
2 months ago
1 week