This repository contains the infrastructure for a high-performance, event-driven quantitative trading engine designed for institutional deployment. The system is engineered to handle high-frequency data ingestion, real-time signal generation, and low-latency execution, all while enforcing strict pre-trade risk compliance.
The architecture follows a modular design, ensuring separation of concerns between data processing, strategy logic, execution routing, and risk management. This allows for rapid strategy iteration and robust deployment in production environments.
The following diagram illustrates the data flow and component interaction within the engine:
graph TD
subgraph Data Layer
A[Data Ingestion] -->|Raw Ticks/Bars| B[Normalization]
B -->|Normalized Tensors| C[Feature Store]
end
subgraph Strategy Layer
C --> D[Strategy Engine]
D -->|Alpha Signals| E[Signal Optimizer]
end
subgraph Risk & Execution
E -->|Proposed Orders| F[Risk Manager]
F -- Approved --> G[Execution Handler]
F -- Rejected --> H[Audit Log]
G -->|FIX/API| I[Exchange]
end
style F fill:#f96,stroke:#333,stroke-width:2px
style D fill:#96f,stroke:#333,stroke-width:2px
- Multi-Source Adapters: Connectors for websocket feeds (Binance, Alpaca, IBKR) and historical data lakes.
- Real-time Normalization: On-the-fly Z-score calculation, volatility scaling, and missing data imputation.
- TimescaleDB Integration: Efficient storage of time-series data for backtesting and replay.
- Abstract Base Class: Enforces a strict interface for all strategies (
on_tick,on_bar,generate_signal). - ML Integration: Native support for PyTorch/TensorFlow models (e.g., FinBERT, LSTM) for signal generation.
- Vectorized Backtesting: Seamless transition from research (VectorBT) to production execution.
- Pre-Trade Compliance: Checks every order against capital limits, leverage ratios, and exposure thresholds before it reaches the exchange.
- Basel III Alignment: Monitors liquidity coverage and net stable funding ratios where applicable.
- VaR Monitoring: Real-time Value-at-Risk calculation to ensure portfolio safety.
- Smart Routing: Algorithms (TWAP, VWAP, Iceberg) to minimize market impact and slippage.
- Exchange Agnostic: Unified API for interacting with centralized exchanges (CEX) and DeFi protocols.
- Latency Optimization: Asynchronous order submission using
asyncioanduvloop.
- Python 3.10+
- Docker & Docker Compose
- Redis (for message bus)
git clone https://github.com/your-org/institutional-trading-engine.git
cd institutional-trading-engine
pip install -r requirements.txtRun the engine in simulation mode:
python -m src.engine --mode simulation --strategy MeanReversionProprietary & Confidential.