AI Agent Hub
Back to skills
OneQuant 4.0 A-Share Quantitative Backtesting & Paper Trading System icon

OneQuant 4.0 A-Share Quantitative Backtesting & Paper Trading System

Data Analysis Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @user_a9caeb3c/quant-backtest-strategy.

About this skill

What Problem Does It Solve?

For individual A-share investors and quantitative strategy learners, building a complete local backtesting and paper trading environment is often complex. It requires separate handling of data acquisition, strategy coding, a backtesting engine, trade simulation, and risk control. OneQuant 4.0 addresses this by providing a locally deployed, integrated environment that consolidates these functions into a single web interface, while also exposing a full set of REST APIs for programmatic use and secondary development.

How Does It Work?

OneQuant 4.0 is a single-page application built on Flask. Its core workflow is as follows:

  1. Data Layer: It integrates data sources like AkShare (free), JQData, and RQData (paid) to fetch A-share historical quotes, real-time snapshots (with ~3-5 second delay), financial data, and sector information. All data is fetched via actual API calls—fabricating data is strictly prohibited.
  2. Strategy & Backtesting Engine: It includes templates for common strategies like MA Golden Cross/Death Cross and RSI Overbought/Oversold. Users can run backtests on specified stocks and timeframes via the web UI or API endpoints such as /api/backtest/ma, generating equity curves and performance metrics. Backtest results exclude transaction costs (commissions, slippage, stamp duty), which must be assessed separately.
  3. Paper Trading & Risk Control: The system provides a local paper trading account for limit/market orders, position management, and trade history. It integrates risk control modules to configure stop-loss/take-profit levels and monitor maximum single-stock position ratios, with risk overviews queryable via APIs like /api/risk/overview.
  4. Invocation & Integration: It offers 5 invocation methods, with the REST API being core. For example, you can use curl or Python requests to call /api/market/kline for candlestick data or /api/selection/list for conditional stock screening (e.g., limiting up stocks). All API responses are in JSON format, and the success field must be checked upon invocation.

Applicable Boundaries and Caveats

This tool is not a universal solution; understanding its boundaries is crucial:

  • Applicable Scenarios: It is ideal for strategy logic validation, technical indicator learning, paper trading practice, and technical analysis of individual A-shares. All trade records and strategy parameters are stored in local JSON files, ensuring data privacy.
  • Non-Applicable Scenarios: Due to its REST API polling (non-event-driven), it is unsuitable for high-frequency trading or scenarios requiring millisecond-level latency. The default mock_broker is a simulation environment and must never be used to operate real brokerage accounts. Data source coverage is primarily A-shares, with limited support for futures, options, or in-depth analysis of Hong Kong/US stocks.
  • Key Limitations: The free data source AkShare's minute-level K-lines are aggregated from 5-minute data, and real-time quotes have a multi-second delay. Backtesting performance depends on Python computation; restarting the service is recommended for long-running sessions (e.g., >7 days). The web server uses Flask's development server, suitable for single-user local use; multi-user concurrency requires deployment to a production environment.

Important Disclaimer: Backtest results are for reference only—past performance does not guarantee future returns. All system functions run locally, and no profitability of any strategy is assured.

Use Cases

  • An individual investor needs to quickly run a historical backtest on a moving average crossover strategy and view the equity curve and performance metrics.
  • A quantitative beginner learning technical analysis needs to view MACD/KDJ/RSI indicators overlaid on a stock chart and understand the logic behind buy/sell signals.
  • A trader needs to practice executing trades in a paper trading environment, requiring position P&L tracking, stop-loss/take-profit setup, and monitoring of the maximum single-stock position ratio.
  • A financial content creator needs to obtain real-time rankings for an industry sector and northbound capital flow data to prepare a daily market briefing chart.

Best For

  • Individual retail traders with strategy ideas but lacking systematic validation tools, who want to backtest strategies and paper trade to检验 logic.
  • Python learners new to quantitative investing who need to understand the backtesting process and technical indicator calculations through a web interface and example strategies.
  • Independent researchers who need to periodically perform batch technical analysis on a watchlist of stocks and export reports for review.
  • Local trading environment maintainers who need to monitor account risk overviews and implement simple automated monitoring scripts via APIs.