Install any skill in seconds. Free to start, no credit card required.
Get Started Free →A股波动率分析/GARCH建模。当用户说"波动率"、"volatility"、"GARCH"、"波动率锥"、"历史波动率"、"隐含波动率"、"HV"、"IV"、"波动率分位"、"XX波动率多少"、"波动率高吗"时触发。分析个股/指数的历史波动率、波动率锥、GARCH预测、隐含波动率对比,辅助判断当前波动率水平和未来波动率趋势。支持研报风格(formal)和快速查看风格(brief)。
.claude/skills/aifinlab-a-share-volatility/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 40% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 33% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 32% | 0% |
| case-19 | ✗→✓ | ▲ Improved | -5% | 0% |
bashSCRIPTS="$SKILLS_ROOT/cn-stock-data/scripts" VOL_SCRIPTS="$SKILLS_ROOT/a-share-volatility/scripts" # 日线 K 线(近 2 年,用于波动率锥和 GARCH 拟合) python "$SCRIPTS/cn_stock_data.py" kline --code [CODE] --freq daily --start [2年前日期] # 实时行情 python "$SCRIPTS/cn_stock_data.py" quote --code [CODE] # 波动率一键分析(HV多窗口 + 波动率锥 + GARCH预测 + EWMA) python "$VOL_SCRIPTS/volatility_analyzer.py" --code [CODE] --start [2年前日期] # 期权隐含波动率(仅限有期权的标的:50ETF/300ETF/个股期权) # 通过 akshare 获取期权数据 python -c "import akshare as ak; df=ak.option_sse_greeks_sina(symbol='510050'); print(df[['IV']].describe())"
Step 1: 数据获取与预处理
volatility_analyzer.py 获取完整波动率分析结果Step 2: 历史波动率计算(多窗口) 计算 5 个滚动窗口的年化历史波动率:
| 窗口 | 用途 | 说明 | |------|------|------| | HV5 | 超短期波动 | 反映近一周波动 | | HV10 | 短期波动 | 反映近两周波动 | | HV20 | 月度波动 | 最常用,对应期权月到期 | | HV60 | 季度波动 | 中期波动水平 | | HV120 | 半年波动 | 长期波动基准 |
计算方法(Close-to-Close):
补充方法(如果有高开低收数据):
Step 3: 波动率锥构建 对每个窗口,计算历史上所有滚动 HV 值的分位数分布:
| 分位数 | 含义 | |--------|------| | P95 | 极高波动(历史 95% 分位) | | P75 | 偏高波动 | | P50 | 中位数(典型水平) | | P25 | 偏低波动 | | P05 | 极低波动(历史 5% 分位) |
当前 HV 在锥中的位置:
波动率锥呈现方式:以窗口为横轴、波动率为纵轴,各分位线形成"锥形",当前值标注在对应位置。
Step 4: GARCH(1,1) 拟合与预测 使用 arch 库拟合 GARCH(1,1) 模型(不可用时 fallback 到 EWMA):
GARCH(1,1) 模型:
GARCH 预测输出:
EWMA 备选(lambda=0.94, RiskMetrics 标准):
Step 5: HV vs IV 对比(如有期权数据) 仅限有期权的标的(50ETF/300ETF 等):
| 维度 | formal(波动率研究报告) | brief(快速波动率查看) | |------|----------------------|----------------------| | 篇幅 | 2-4 页 | 半页 | | HV 多窗口 | 5 个窗口全部列出 + 趋势判断 | HV20 + HV60 两个关键窗口 | | 波动率锥 | 完整分位数表 + 文字描述锥形 | 当前 HV20 所处分位 | | GARCH | 完整参数 + 预测 + 模型诊断 | 一句话预测方向 | | IV 对比 | 详细 HV-IV 分析 + 策略建议 | IV vs HV 一句话 | | 波动率特征 | 聚集性/均值回归/非对称性分析 | 省略 | | 结论 | 多维度总结 + 波动率交易建议 | 高/正常/低 + 趋势 | | 免责声明 | 需要 | 不需要 |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-07 | fail→pass | 18,205 | 15,786 | -13% | 1 | 1 | 0% | 3,182 | 4,465 | +40% | 0 | 0 | — |
case-01 | fail→fail | 13,700 | 29,022 | +112% | 1 | 1 | 0% | 1,839 | 2,057 | +12% | 0 | 0 | — |
case-02 | fail→fail | 31,994 | 13,018 | -59% | 1 | 1 | 0% | 5,439 | 2,607 | -52% | 0 | 0 | — |
case-03 | fail→fail | 27,896 | 10,328 | -63% | 1 | 1 | 0% | 4,482 | 2,085 | -53% | 0 | 0 | — |
case-04 | pass→pass | 27,356 | 38,287 | +40% | 1 | 1 | 0% | 5,481 | 8,658 | +58% | 0 | 0 | — |
case-05 | pass→pass | 21,475 | 21,154 | -1% | 1 | 1 | 0% | 4,194 | 6,417 | +53% | 0 | 0 | — |
case-06 | pass→fail | 30,458 | 12,253 | -60% | 1 | 1 | 0% | 4,650 | 2,436 | -48% | 0 | 0 | — |
case-08 | fail→pass | 18,890 | 17,972 | -5% | 1 | 1 | 0% | 3,093 | 4,123 | +33% | 0 | 0 | — |
case-09 | pass→pass | 15,189 | 6,137 | -60% | 1 | 1 | 0% | 2,547 | 2,638 | +4% | 0 | 0 | — |
case-10 | pass→pass | 16,074 | 14,973 | -7% | 1 | 1 | 0% | 2,347 | 3,806 | +62% | 0 | 0 | — |
case-11 | pass→pass | 18,723 | 18,099 | -3% | 1 | 1 | 0% | 2,795 | 4,374 | +56% | 0 | 0 | — |
case-12 | pass→pass | 24,719 | 26,155 | +6% | 1 | 1 | 0% | 3,258 | 5,084 | +56% | 0 | 0 | — |
case-13 | pass→pass | 21,640 | 19,891 | -8% | 1 | 1 | 0% | 2,919 | 4,510 | +55% | 0 | 0 | — |
case-14 | pass→pass | 16,756 | 17,185 | +3% | 1 | 1 | 0% | 2,481 | 4,133 | +67% | 0 | 0 | — |
case-15 | pass→pass | 14,735 | 16,255 | +10% | 1 | 1 | 0% | 2,138 | 4,080 | +91% | 0 | 0 | — |
case-16 | pass→pass | 21,843 | 19,892 | -9% | 1 | 1 | 0% | 3,176 | 4,825 | +52% | 0 | 0 | — |
case-17 | fail→pass | 28,458 | 27,873 | -2% | 1 | 1 | 0% | 4,139 | 5,358 | +29% | 0 | 0 | — |
case-18 | fail→pass | 24,772 | 20,740 | -16% | 1 | 1 | 0% | 3,288 | 4,327 | +32% | 0 | 0 | — |
case-19 | fail→pass | 14,587 | 3,844 | -74% | 1 | 1 | 0% | 2,290 | 2,177 | -5% | 0 | 0 | — |
case-20 | fail→pass | 15,011 | 5,422 | -64% | 1 | 1 | 0% | 2,451 | 2,406 | -2% | 0 | 0 | — |
case-21 | pass→pass | 16,801 | 16,469 | -2% | 1 | 1 | 0% | 2,889 | 4,484 | +55% | 0 | 0 | — |
case-22 | fail→pass | 24,323 | 17,093 | -30% | 1 | 1 | 0% | 3,614 | 4,374 | +21% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 18 counted toward the lift figure. The other 4 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +27 percentage points is the difference between those two pass rates over the 18 comparable cases. 3 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.