This is a containerized algorithmic trading system that connects to Interactive Brokers to execute high-frequency pairs trading strategies on forex instruments. The project implements a mean-reversion model that maintains long-short position pairs, continuously recalculating a beta hedge ratio to profit from temporary divergences in correlated price spreads.
The system processes each incoming market tick through a signal pipeline that immediately evaluates indicators and triggers market orders without batching or aggregation. It includes an irregular tick resampling engine that converts inhomogeneous tick data into uniform time series for consistent quantitative analysis. The architecture runs in a Docker-isolated headless environment, enabling remote deployment and automated execution on server infrastructure without a graphical interface.
The trading model supports historical backtesting to derive initial strategy parameters such as beta and volatility thresholds before switching to live data feeds. Order execution happens synchronously within the main event loop, relying on the Interactive Brokers API's callback mechanism for confirmation and error handling. The system also periodically re-evaluates the hedge ratio between paired securities at set time intervals to maintain neutrality.