Skip to content

bondtrade/vectorbt-backtest-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Institutional-Grade Quantitative Trading Engine

Overview

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.

System Architecture

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
Loading

Key Components

1. Data Ingestion & Normalization

  • 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.

2. Strategy Engine

  • 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.

3. Risk Management (The "Guardian")

  • 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.

4. Execution Handler

  • 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 asyncio and uvloop.

Getting Started

Prerequisites

  • Python 3.10+
  • Docker & Docker Compose
  • Redis (for message bus)

Installation

git clone https://github.com/your-org/institutional-trading-engine.git
cd institutional-trading-engine
pip install -r requirements.txt

Usage

Run the engine in simulation mode:

python -m src.engine --mode simulation --strategy MeanReversion

License

Proprietary & Confidential.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages