A股回撤分析/最大回撤量化

SkillMonitoring & ops

A-share drawdown analysis / max drawdown quantification / drawdown statistics. Triggered when the user says "回撤", "drawdown", "最大回撤", "回撤分析", "回撤统计", "历史回撤", "水下曲线", "亏了多少", "从高点跌了多少", "回撤修复", "回撤天数". MUST USE when user asks about drawdown metrics, max drawdown calculation, or historical drawdown an

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the A股回撤分析/最大回撤量化 skill

What this skill tells your AI

The instructions your AI receives, as published by aifinlab/finclaw in skills/a-share-drawdown-analysis/SKILL.md and read by ahel’s review.

数据源

SCRIPTS="$SKILLS_ROOT/cn-stock-data/scripts"
python "$SCRIPTS/cn_stock_data.py" kline --code [CODE] --freq daily --start [日期]
python "$SCRIPTS/cn_stock_data.py" quote --code [CODE]
python "$SCRIPTS/cn_stock_data.py" finance --code [CODE]

Workflow

Step 1: 获取K线数据

获取足够长的历史数据(建议 2 年以上)。

Step 2: 计算回撤序列

  • 滚动最高价 = max(close[:t])
  • 回撤 = (close - 滚动最高价) / 滚动最高价 × 100%
  • 最大回撤 = min(回撤序列)

Step 3: 回撤事件分析

  • 识别所有回撤 > 10% 的事件
  • 每次回撤的起点/终点/最低点/持续天数/恢复天数
  • 回撤期间成交量变化

Step 4: 回撤统计

  • 平均回撤深度/持续时间/恢复时间
  • 回撤频率(年均几次 > 5%/10%/20%)
  • 与大盘回撤的对比(β调整后回撤)

Step 5: 输出

维度formalbrief
回撤序列完整回撤图表+事件表最大回撤值
统计分析回撤分布+恢复时间关键统计
风险评估压力测试情景当前回撤状态

默认风格:brief。

关键规则

  1. 最大回撤是衡量风险的核心指标之一
  2. 恢复时间往往比回撤深度更影响投资者体验
  3. A 股历史上大盘级别回撤:2008(-72%)、2015(-49%)、2018(-31%)
  4. 个股回撤通常远大于指数回撤
  5. 回撤期间的成交量放大通常意味着恐慌性抛售

使用示例

示例 1: 基本使用

# 调用 skill
result = run_skill({
    "param1": "value1",
    "param2": "value2"
})

示例 2: 命令行使用

python scripts/run_skill.py --input data.json

Signals

GitHub stars
241
Forks
38
Last commit
May 2026
Advanced
Catalog kind
skill
Gateway key
a-share-drawdown-analysis
Source
github.com/aifinlab/finclaw