← 返回 Skills 市场
miio-jinglin

China Stock Quant

作者 Miio-Jinglin · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
182
总下载
0
收藏
3
当前安装
1
版本数
在 OpenClaw 中安装
/install china-stock-quant
功能描述
A-share quantitative analysis toolkit. Use when user wants to analyze Chinese stocks, backtest trading strategies, calculate technical indicators (MACD/KDJ/R...
使用说明 (SKILL.md)

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接口速查
安全使用建议
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.
功能分析
Type: OpenClaw Skill Name: china-stock-quant Version: 1.0.0 The 'china-stock-quant' skill bundle is a legitimate quantitative analysis toolkit for the Chinese A-share and ETF markets. It utilizes the well-known 'akshare' library for data retrieval and provides standard implementations for technical indicators (MACD, KDJ, RSI) and backtesting strategies (Grid, MA Crossover) across files like scripts/fetch_data.py and scripts/backtest.py. No evidence of data exfiltration, malicious execution, or harmful prompt injection was found; the code and documentation are strictly aligned with the stated purpose of financial analysis.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install china-stock-quant
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /china-stock-quant 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
Slug china-stock-quant
版本 1.0.0
许可证 MIT-0
累计安装 3
当前安装数 3
历史版本数 1
常见问题

China Stock Quant 是什么?

A-share quantitative analysis toolkit. Use when user wants to analyze Chinese stocks, backtest trading strategies, calculate technical indicators (MACD/KDJ/R... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 182 次。

如何安装 China Stock Quant?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install china-stock-quant」即可一键安装,无需额外配置。

China Stock Quant 是免费的吗?

是的,China Stock Quant 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

China Stock Quant 支持哪些平台?

China Stock Quant 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 China Stock Quant?

由 Miio-Jinglin(@miio-jinglin)开发并维护,当前版本 v1.0.0。

💬 留言讨论