QUANTAXIS Documentation

repository·master·Indexed 27 days ago

https://github.com/yutiansut/quantaxis

A quantitative financial framework for high-performance trading, backtesting, and data management. It features a Python 3.9+ stack and a Rust-based core (QARS2/qapro-rs v0.1.1) for optimized account operations. The system includes tools for data acquisition, strategy development, and deployment via Docker and Kubernetes, with core modules such as QAFetch, QAData, QAMarket, and QIFI.

Tokens
94.5K
Snippets
252
Records
433
Agent score
86%

What's inside QUANTAXIS

  1. Overview of QAFetch module

    master

    The QAFetch module in QUANTAXIS provides a unified interface for fetching various financial data across multiple asset classes and data sources.

    Key Features:

    • Multi-source support: TDX (通达信), Tushare, THS (同花顺), East Money (东方财富), etc.
    • Unified API: All data sources use consistent calling patterns.
    • Asset Coverage: Stocks, Futures, Options, Cryptocurrency, Hong Kong stocks, and US stocks.
    • Timeframes: Daily, Minute, Tick, and Real-time data.
    • Flexible Formats: Returns data as pandas.DataFrame, JSON, or NumPy arrays.

    Core Components:

    • QAQuery: MongoDB query interface.
    • QATdx: TDX data source.
    • QATushare: Tushare data source.
    • QAfinancial: Financial data.
  2. Overview of QABook learning topics

    master

    QABook is organized into several key thematic areas for systematic learning:

    • Core Functions: Data management, analysis methods, trading system implementation, and visualization.
    • Mathematical Foundations (Critical): Convex optimization (Kuhn-Tucker conditions), Matrix theory (Cholesky decomposition, EVD, SVD, etc.), Random Matrix Theory (Marcenko–Pastur law), and Statistics (Covariance matrix denoising, parameter estimation).
    • Asset Management: Modern portfolio theory, risk-return tradeoffs, and optimization strategies.
    • Advanced Topics: Active portfolio management (Alpha strategies), derivative pricing (Black-Scholes), and overfitting mitigation in machine learning.
  3. Overview of QA_DataStruct capabilities

    master

    The QA_DataStruct is a specialized data container designed for quantitative financial data analysis. It provides a comprehensive suite of tools for data manipulation, transformation, and visualization. Key functionalities include:

    • Data Transformation: Split, merge, and reverse data sequences.
    • Data Reshaping: Pivot operations for multi-dimensional analysis.
    • Data Selection/Filtering:
      • select_time: Filter by time.
      • select_time_with_gap: Filter by time while handling gaps.
      • select_code: Filter by security/ticker code.
      • get_bar: Retrieve specific bar data.
    • Financial Adjustments: Convert data to forward-adjusted (to_hfq) or backward-adjusted (to_qfq) formats.
    • Format Conversion: Export data to json, pandas (DataFrame), list, or numpy arrays.
    • Querying: Database-style querying via the query method.
    • Visualization: Built-in show for display and plot for graphical representation.
  4. Access QUANTAXIS documentation and resources

    master

    The QUANTAXIS documentation center provides several specialized guides and references:

    • Getting Started: Installation and Quickstart guides.
    • User Guide: Covers data acquisition, strategy development, backtesting, and live trading.
    • API Reference: Overview of core modules including QAFetch, QAData, QAMarket, and QIFI.
    • Advanced Features: Resource Manager, Rust Integration, and Data Bridge.
    • Deployment: Overview, Docker, and Kubernetes deployment guides.
    • Migration: Guides for upgrading from v2.0 to v2.1 and compatibility status.
    • QABook: A complete PDF technical manual. You can download pre-compiled versions from the GitHub Releases page or build it locally using the LaTeX compilation guide.
  5. Understand the definition and purpose of QAFactor

    master

    A feature in QAFactor is a metric calculated from market or alternative data across a stock pool (e.g., full market or custom market). It serves as a derivative or further processing step of the QAIndicator module, or as a fundamental control within a factor investment framework.

    Key design principles:

    • Data Preservation: Instead of embedding a full research framework, feature focuses on storing initial calculated values to allow for comprehensive data analysis and maximum retention of raw data.
    • Storage & Iteration: Calculated results can be stored in ClickHouse. Features can be processed via featureAnalysis (e.-g., neutralization, standardization) and then re-stored using the same feature base class.
    • Management: The feature base class includes built-in version control and description fields to facilitate the management of factor iterations.
  6. Understand the QUANTAXIS backtesting architecture

    master

    QUANTAXIS provides a customizable framework for backtesting trading ideas to determine profit ranges and validate strategies. The architecture is built around two core components:

    1. QIFI (Customizable Account Structure): Provides a flexible account structure for the backtesting environment.
    2. QAStrategy (Data-Driven Testing Process): Manages the data-driven execution of the test process.

    The framework is designed to be non-restrictive; you are not limited to a specific way of constructing your backtesting code, allowing for high levels of customization.

  7. Understand the QUANTAXIS Core Modules

    master

    QUANTAXIS is a closed-loop quantitative trading framework. The core project consists of several specialized modules that handle the data-to-trading lifecycle:

    • QAARP: Account, Portfolio, and Risk management.
    • QAMARKET: Market access, multi-market support, local backtesting, and order management.
    • QAApplication: Application layer.
    • QAFetch / QASU: Data acquisition and storage.
    • QAData: Data analysis.
    • QAIndicator: Indicator system.
    • QASetting / QAUtil: Configuration and utility functions.

    The workflow follows: Data Acquisition/Storage/Analysis ==> Strategy/Backtesting ==> Simulation/Live Trading.

  8. Understand the Quantaxis philosophy of strategy management

    master

    Quantaxis approaches quantitative trading not as a search for a single 'super-strategy' (high IC, high Sharpe), but as the construction of a systematic 'strategy factory'.

    Key principles for users building with this framework:

    • Avoid the 'Toxic Apple' trap: Do not judge success solely on a single strategy's performance. A single high-performing strategy is often an outlier and can lead to unrealistic expectations.
    • Focus on $\lambda$ (Management/Weighting) over $X$ (Individual Signals): In complex markets, the goal is not to find the perfect signal ($X$), but to build a system that effectively manages the weights ($\lambda$) of multiple signals. This is analogous to a neural network managing weights via backpropagation.
    • Build a Strategy Factory: A strategy is just an input ($X_n$). The real value lies in the standardized process of analyzing, standardizing, and managing these inputs through a robust organizational/mathematical system.
    • Diversification and Low Collinearity: When producing multiple strategies, ensure they are not just repetitions of the same type. High collinearity between strategies provides no benefit over a single strategy.
    • Focus on BR (Business/Systematic Returns): Quant trading success comes from the systematic management of models and signals, rather than manual trading or finding a single 'magic' code snippet.
  9. Understand core QUANTAXIS concepts

    master

    Key architectural components:

    • QUANTAXIS: Full-stack Python quantitative finance framework.
    • QIFI (Quantitative Investment Framework Interface): Unified account system interface supporting Python, Rust, and C++.
    • QARS2 (QUANTAXIS Rust): High-performance Rust implementation for data processing and indicator calculation.
    • QADataFrame: Custom data structure extending pandas.DataFrame with financial-specific methods.
  10. Explore the QUANTAXIS ecosystem and community resources

    master

    QUANTAXIS is an open-source community providing a closed-loop quantitative solution (Idea $\rightarrow$ Analysis $\rightarrow$ Strategy $\rightarrow$ Backtest $\rightarrow$ Simulation $\rightarrow$ Live Trading $\rightarrow$ Visualization).

    Key Project Components:

    Community Support:

    • QQ Group: 563280067
    • Bug Reporting: GitHub Issues
    • Contributions: Use GitHub Pull Requests. Place project experiences/insights in the Documents/ folder and code in the QUANTAXIS/ directory.
  11. Understand the QIFI Protocol Overview

    master

    QIFI (Quantaxis Differential Information Flow for Finance Integration) is the core account protocol in the QUANTAXIS ecosystem. It provides a unified account representation across multiple languages (Python, Rust, C++) and markets (Stocks, Futures, Options).

    Key Features:

    • Cross-language compatibility: Identical data structures for Python, Rust, and C++.
    • Full account state: Includes accounts, positions, orders, trades, and transfers.
    • Incremental updates: Supports efficient state synchronization via a Diff mechanism.
    • MongoDB friendly: Maps directly to MongoDB document structures.
    • JSON serialization: Uses standard JSON for easy cross-system transmission.