China Stock Quant

v1.0.0

A-share quantitative analysis toolkit. Use when user wants to analyze Chinese stocks, backtest trading strategies, calculate technical indicators (MACD/KDJ/R...

0· 194·3 current·3 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for miio-jinglin/china-stock-quant.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "China Stock Quant" (miio-jinglin/china-stock-quant) from ClawHub.
Skill page: https://clawhub.ai/miio-jinglin/china-stock-quant
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install china-stock-quant

ClawHub CLI

Package manager switcher

npx clawhub@latest install china-stock-quant
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the included Python scripts: fetch_data.py (akshare calls), technical_indicators.py (MACD/KDJ/RSI/Bollinger/etc.), and backtest.py (grid/MA/Bollinger backtests and risk metrics). Required libraries (akshare, pandas, numpy, matplotlib) are appropriate for the stated functionality.
Instruction Scope
SKILL.md instructs installing common Python packages and using the provided scripts; runtime instructions only reference stock/ETF data, indicator calculation, and backtests. There are no instructions to read unrelated local files, environment secrets, or to send data to external endpoints beyond the normal network calls used by akshare.
Install Mechanism
No install spec in the registry (instruction-only). SKILL.md suggests pip installing well-known packages (akshare/pandas/numpy/matplotlib). This is standard for a Python data-analysis toolkit; there are no downloads from unknown URLs or archive extraction steps in the skill metadata.
Credentials
The skill requests no environment variables or credentials. It uses akshare, which performs web requests/scraping to fetch market data — network access is required but is proportional to the skill's purpose. No secrets or unrelated credentials are requested.
Persistence & Privilege
The skill is not always-enabled and does not request elevated persistence. It does not modify other skills or system-wide settings. Agent autonomous invocation remains allowed (platform default) but is not combined with other concerning flags.
Assessment
This package appears to do what it says: fetch Chinese market data (via akshare), compute indicators, and run backtests. Things to consider before installing: 1) akshare scrapes public data sources — it will make outbound network requests; if you must restrict network access, run in a sandbox. 2) pip installing packages runs third‑party code from PyPI — consider pinning versions (e.g., akshare==<version>) and review package histories. 3) No credentials are requested, so do not supply API keys or trading credentials to this skill. 4) Test on cached or small datasets before using real capital; backtest code is a simple simulator and may not cover execution slippage, fees, or real-world constraints. If you want extra assurance, run the provided scripts in an isolated environment and inspect akshare's behavior or pin its version.

Like a lobster shell, security has layers — review code before you run it.

aksharevk972xbg2acvhv4fmx9z16gy0k183h44vchina-stockvk972xbg2acvhv4fmx9z16gy0k183h44vlatestvk972xbg2acvhv4fmx9z16gy0k183h44vquantvk972xbg2acvhv4fmx9z16gy0k183h44vtradingvk972xbg2acvhv4fmx9z16gy0k183h44v
194downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

A股量化分析

基于 akshare(免费无需token)的A股量化分析工具包。

快速开始

pip install akshare pandas numpy matplotlib

工作流

1. 获取数据

from scripts.fetch_data import *
# ETF日线
df = fetch_etf_daily("159915", "20250101", "20260301")
# 个股日线
df = fetch_stock_daily("000001", "20250101", "20260301")
# ETF分时(日内做T)
df = fetch_etf_intraday("159915")
# 实时行情
df = fetch_realtime("159915")

详见 references/api-reference.md

2. 计算技术指标

from scripts.technical_indicators import *
# 单指标
df['macd'], df['signal'], df['hist'] = calc_macd(df['close'])
df['k'], df['d'], df['j'] = calc_kdj(df['high'], df['low'], df['close'])
df['rsi'] = calc_rsi(df['close'], period=14)
df['upper'], df['mid'], df['lower'] = calc_bollinger(df['close'])
df['vol_ratio'] = calc_volume_ratio(df['volume'])
# 一键全部
df = add_all_indicators(df)
# 信号检测
signals = detect_signals(df)

3. 策略回测

from scripts.backtest import *
result = run_backtest(
    df,
    strategy="grid",           # grid / ma_cross / bollinger
    initial_capital=100000,
    grid_num=10,               # 网格数(grid策略)
    ma_short=5, ma_long=20,    # 均线参数(ma_cross策略)
    stop_loss=0.05,            # 止损比例
    take_profit=0.10,          # 止盈比例
)
print(result.summary())

4. 风险评估

from scripts.backtest import assess_risk
risk = assess_risk(df['close'])
# returns: max_drawdown, sharpe_ratio, annual_volatility, calmar_ratio

策略库

ETF日内做T策略详解见 references/strategies.md,包含:

策略适用场景核心逻辑
网格交易震荡市价格跌破网格线买入,涨回卖出
均线交叉趋势市短均线上穿长均线买入,下穿卖出
布林带回归均值回归触下轨买入,触上轨卖出
波动率突破突破行情ATR放大+价格突破时追入

风控参数(内置默认值)

RISK_PARAMS = {
    "max_position_pct": 0.25,    # 单只持仓上限
    "stop_loss": 0.05,           # 止损线 5%
    "take_profit": 0.10,         # 止盈线 10%
    "max_daily_turnover": 0.05,  # 日内做T最大换手
    "min_trade_amount": 10000,   # 最低交易金额(元)
    "max_drawdown_limit": 0.15,  # 最大回撤警戒线
}

资源文件

  • scripts/fetch_data.py — 数据获取
  • scripts/technical_indicators.py — 技术指标计算
  • scripts/backtest.py — 回测引擎+风险评估
  • references/strategies.md — 策略库详解
  • references/api-reference.md — akshare接口速查

Comments

Loading comments...