QUANTAXIS
QUANTAXIS 支持任务调度 分布式部署的 股票/期货/期权 数据/回测/模拟/交易/可视化/多账户 纯本地量化解决方案
A Python framework for quantitative finance and algorithmic trading in Chinese financial markets, combining market data retrieval, backtesting, live trading connections, factor research, and multi-account management in one self-hosted package.
QUANTAXIS is a Python framework for quantitative finance, designed for trading and researching Chinese financial markets: stocks, futures, and options. The README is written in Chinese. It packages together market data retrieval, backtesting, paper trading simulation, live trading connections, visualization, and multi-account management in one codebase, meant to run entirely on your own machine rather than through a cloud service.
The framework is organized into about a dozen modules. The data layer (QAFetch and QASU) downloads and stores historical and real-time market data, supporting MongoDB and ClickHouse as storage backends. QAData provides an in-memory data structure for fast access during calculations. QAStrategy handles backtesting: you write a strategy that describes when to buy and sell, and the backtesting engine replays historical data through it and reports performance. QAFactor supports factor research, which is an approach where you define measurable signals (like momentum or valuation ratios) and test whether they predict price movements. QAPubSub handles messaging between components using RabbitMQ, useful for distributing calculations or streaming live order flow between processes.
Version 2.1 added a significant performance upgrade through a component called QARSBridge, which wraps a Rust-based core called QARS2. This changes account operations from taking around 50 milliseconds down to around half a millisecond, and reduces the time to backtest ten years of daily data from roughly 30 seconds to about 3 seconds. It also cuts memory usage for large portfolios by around 90 percent. If the Rust component is not installed, the library falls back to a pure Python implementation automatically without breaking the API.
The framework also includes a web server component for building internal tools, a scheduler for running automated tasks at specified times, and connection adapters for real-world trading systems including the CTP interface common in Chinese futures trading and the QMT interface for equities.
Installation is via pip with optional extras for the Rust components, performance libraries, or the full package.
Where it fits
- Run backtests of stock or futures trading strategies against 10 years of historical Chinese market data
- Stream live market data and execute trades through CTP futures or QMT equities broker interfaces
- Research price-prediction signals such as momentum or valuation ratios using the built-in factor framework