A-Share Quantitative Finance Toolkit for Openclaw

A lightweight, zero-dependency quantitative analysis toolkit for Chinese A-shares powered by free, real-time Tencent Market Data APIs.

dnaxxx-hub
v1.0.0
May 30, 2026
1
789
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install a-stock-quant-toolkit

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install a-stock-quant-toolkit using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is A-Share Quantitative Finance Toolkit?

The A-Share Quantitative Finance Toolkit is a comprehensive Python library designed for automated trading, backtesting, and market analysis in the Chinese stock market. Built with a focus on speed and efficiency, its core modules require zero external dependencies, pulling real-time market quotes and historical K-lines directly from Tencent APIs without any registration or API keys.

Integrating this toolkit with Openclaw Skills allows AI-driven coding agents to autonomously fetch market data, perform technical indicator sweeps, assess trading alerts, and write daily summary reports. This transforms static quantitative codebases into dynamic, AI-assisted decision-making engines.

A-Share Quantitative Finance Toolkit Use Cases

  • Real-Time Stock Monitoring: Track Chinese A-shares instantly with sub-second latency and zero external dependency runtimes.
  • Multi-Strategy Backtesting: Run up to 10 backtesting models simultaneously on historical pre-adjusted stock prices to identify optimized entry/exit levels.
  • FFT Cycle Analysis: Compute Fast Fourier Transforms on historical close prices to discover dominant market cycles and cycle-driven suggestions.
  • Intelligent Stock Scoring: Leverage a 60-point multi-dimensional technical scoring engine to qualify equity assets automatically.
  • AI Agent Automation: Empower agents powered by Openclaw Skills to run headless scans, generate markdown digests, and evaluate custom technical indicator fusions.

How A-Share Quantitative Finance Toolkit Works

  1. Direct API Fetching: The toolkit invokes standard Python sockets/urllib modules to fetch real-time quotation streams from Tencent's financial endpoints (qt.gtimg.cn).
  2. Indicator Generation: Calculations like SMA, Bollinger Bands, RSI, KDJ, and MACD are generated across historical data slices.
  3. Spectral Processing: Pure-Python Fourier transform utilities identify the primary cycle periods of active stock prices.
  4. Backtest Benchmarking: Parameter sweeping routines test variations of standard trading models to output performance ranking matrix tables.
  5. Reporting: Automatic compilation engines format market metrics and system feedback into text reports or visual K-line chart PDFs.

A-Share Quantitative Finance Toolkit Setup

The quantitative toolkit supports a dual runtime setup depending on your system's capabilities.

Minimal Installation

For real-time price monitoring, scoring, and FFT calculations, only standard Python 3 is required. No packages are needed.

For backtesting, visual graphing, and advanced parameter optimization, run the following CLI commands:

pip install pandas numpy akshare matplotlib mplfinance

Command-Line Execution

Execute strategies and sweeps directly via standard CLI flags:

# Standard quick backtest run
python -m finance_toolkit.backtest_v3 brief

# Advanced run with split segment analytics
python -m finance_toolkit.backtest_v3 full

# Run comprehensive parameter search sweeps
python -m finance_toolkit.backtest_v3 scan

# Perform multi-indicator fusion optimizations
python -m finance_toolkit.backtest_v3 fusion_scan

A-Share Quantitative Finance Toolkit Data Schema & Taxonomy

The toolkit handles streamlined structures for quotes, scores, and spectral metrics. It accepts standard ticker formats including Shanghai (sh600519), Shenzhen (sz000009), or naked codes (000009).

Tencent API Quote Fields

Field Name Type Purpose Example
name String Chinese name of the stock asset 中国宝安
price Float Current real-time price 9.45
change_pct Float Percentage change from previous close 1.24

Backtest Engine Outputs

Metric Value Type Purpose Range
score Integer Overall technical strength 0 to 60
dominant_cycle Integer Peak spectral frequency Number of days
signals Array Generated active technical flags SMA Cross, RSI Overbought

A-Share Quantitative Finance Toolkit Advanced Features

  • Dependency-Free Implementation: Run core modules like mini_realtime.py securely in constrained environments without installing third-party frameworks.
  • Cycle Recommendation Engine: Leverage the FFT-based signal processor to detect price frequencies and provide actionable period-based advice.
  • Multi-Indicator Fusion Strategy: Combine RSI, Bollinger Bands, MACD, and KDJ into an integrated strategy block preventing false breakouts.
  • Agentic Openclaw Skills Integration: Let AI assistants interact with financial models, enabling them to query quotes, backtest formulas, and explain results to human analysts.
  • High-Performance Parameter Sweeping: Run grid search across multi-strategy dimensions to programmatically locate localized and global equity return maxima.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*