Install any skill in seconds. Free to start, no credit card required.
Get Started Free →A股量化因子库/因子速查/因子计算公式查询。当用户说"因子库"、"有哪些因子"、"factor library"、"怎么算XX因子"、"价值因子"、"动量因子"、"质量因子"、"波动率因子"、"因子定义"、"因子公式"、"查因子"、"因子速查"、"列出所有因子"、"EP怎么算"、"BP公式"、"因子字段"时触发。MUST USE when user asks for factor definitions, formulas, or wants to look up how a specific quantitative factor is calculated. 提供A股常用量化因子的完整定义、计算公式、数据字段映射,覆盖价值/成长/质量/动量/波动率/规模/流动性七大类50+因子。支持研报风格(formal)和快速查询风格(brief)。
.claude/skills/aifinlab-a-share-factor-library/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 22% | 0% |
| case-09 | ✗→✓ | ▲ Improved | -6% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -8% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -9% | 0% |
cn-stock-data finance(adata 43字段: basic_eps, roe_wtd, roa_wtd, gross_margin, net_margin, total_rev, net_profit_attr_sh, total_rev_yoy_gr, net_profit_yoy_gr 等)cn-stock-data kline(date, open, close, high, low, volume, amount, turnover_rate, pct_change)cn-stock-data quote(price, pe_ttm, market_cap, float_market_cap, volume_ratio)bashSCRIPTS_DIR="$SKILLS_ROOT/a-share-factor-library/scripts" CN_STOCK="$SKILLS_ROOT/cn-stock-data/scripts" # 计算单个因子 python "$SCRIPTS_DIR/factor_calculator.py" --factor ep --codes SH600519,SZ000858 # 动量因子 python "$SCRIPTS_DIR/factor_calculator.py" --factor momentum_6m --codes SH600519 # 批量计算一类因子 python "$SCRIPTS_DIR/factor_calculator.py" --category value --codes SH600519,SZ000858 # 列出所有因子 python "$SCRIPTS_DIR/factor_calculator.py" --list # 查看某个因子定义 python "$SCRIPTS_DIR/factor_calculator.py" --info ep
详见 references/factor-library-catalog.md,包含全部 7 大类因子的:
根据用户请求判断:
从 references/factor-library-catalog.md 查找:
将因子公式中的变量映射到实际数据接口:
cn-stock-data finance --code XXXcn-stock-data kline --code XXX --freq daily --start YYYY-MM-DDcn-stock-data quote --code XXX调用 scripts/factor_calculator.py 或手动计算:
bashpython "$SCRIPTS_DIR/factor_calculator.py" --factor <factor_name> --codes <code1,code2,...>
formal(研报风格):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
因子名称: EP(盈利收益率)
英文全称: Earnings-to-Price Ratio
类别: 价值因子 | 方向: 正向(越大越便宜)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
公式: EP = EPS_TTM / Price = 1 / PE_TTM
数据源: cn-stock-data quote → pe_ttm
适用行业: 全行业(金融/周期股慎用)
计算结果:
| 股票 | EPS_TTM | Price | EP | 排名 |
|------|---------|-------|----|------|
| 贵州茅台 | 66.3 | 1895.5 | 0.035 | 1 |
| 五粮液 | 7.2 | 168.0 | 0.043 | 2 |
因子解读:
EP 值越大说明股票越"便宜",是经典价值因子。
建议与 BP、CFP 等因子组合使用,避免单一因子陷阱。
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━brief(快速查询风格):
EP = 1/PE_TTM | 方向:正 | 数据:quote.pe_ttm
SH600519: EP=0.035 | SZ000858: EP=0.043| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 23,677 | 8,417 | -64% | 1 | 1 | 0% | 3,555 | 1,732 | -51% | 0 | 0 | — |
case-02 | fail→fail | 27,298 | 7,151 | -74% | 1 | 1 | 0% | 4,026 | 1,653 | -59% | 0 | 0 | — |
case-03 | fail→fail | 22,663 | 8,149 | -64% | 1 | 1 | 0% | 4,389 | 1,629 | -63% | 0 | 0 | — |
case-04 | fail→fail | 30,462 | 11,365 | -63% | 1 | 1 | 0% | 6,769 | 1,833 | -73% | 0 | 0 | — |
case-05 | fail→fail | 24,034 | 7,746 | -68% | 1 | 1 | 0% | 3,575 | 1,521 | -57% | 0 | 0 | — |
case-06 | fail→fail | 27,133 | 7,144 | -74% | 1 | 1 | 0% | 4,283 | 1,567 | -63% | 0 | 0 | — |
case-07 | fail→pass | 10,952 | 4,772 | -56% | 1 | 1 | 0% | 1,760 | 1,901 | +8% | 0 | 0 | — |
case-08 | fail→pass | 10,080 | 3,486 | -65% | 1 | 1 | 0% | 1,409 | 1,726 | +22% | 0 | 0 | — |
case-09 | fail→pass | 15,887 | 3,519 | -78% | 1 | 1 | 0% | 2,022 | 1,893 | -6% | 0 | 0 | — |
case-18 | fail→fail | 24,935 | 11,719 | -53% | 1 | 1 | 0% | 3,424 | 1,879 | -45% | 0 | 0 | — |
case-10 | fail→pass | 11,339 | 3,565 | -69% | 1 | 1 | 0% | 2,017 | 1,865 | -8% | 0 | 0 | — |
case-11 | fail→pass | 14,905 | 10,092 | -32% | 1 | 1 | 0% | 2,482 | 2,252 | -9% | 0 | 0 | — |
case-12 | fail→pass | 11,928 | 8,936 | -25% | 1 | 1 | 0% | 2,023 | 2,486 | +23% | 0 | 0 | — |
case-13 | fail→pass | 15,293 | 6,228 | -59% | 1 | 1 | 0% | 2,372 | 2,300 | -3% | 0 | 0 | — |
case-14 | pass→pass | 23,568 | 15,778 | -33% | 1 | 1 | 0% | 3,327 | 3,471 | +4% | 0 | 0 | — |
case-15 | pass→pass | 14,178 | 11,759 | -17% | 1 | 1 | 0% | 1,875 | 3,093 | +65% | 0 | 0 | — |
case-16 | pass→pass | 13,791 | 6,774 | -51% | 1 | 1 | 0% | 1,872 | 2,211 | +18% | 0 | 0 | — |
case-17 | fail→pass | 6,846 | 3,496 | -49% | 1 | 1 | 0% | 974 | 1,738 | +78% | 0 | 0 | — |
case-19 | fail→pass | 15,501 | 9,979 | -36% | 1 | 1 | 0% | 2,077 | 2,222 | +7% | 0 | 0 | — |
case-20 | fail→pass | 12,106 | 8,563 | -29% | 1 | 1 | 0% | 1,665 | 2,374 | +43% | 0 | 0 | — |
case-21 | pass→pass | 15,591 | 12,265 | -21% | 1 | 1 | 0% | 2,104 | 3,357 | +60% | 0 | 0 | — |
case-22 | fail→pass | 6,604 | 4,568 | -31% | 1 | 1 | 0% | 939 | 1,768 | +88% | 0 | 0 | — |
case-23 | fail→pass | 23,233 | 12,422 | -47% | 1 | 1 | 0% | 2,138 | 2,609 | +22% | 0 | 0 | — |
case-24 | pass→pass | 11,271 | 9,953 | -12% | 1 | 1 | 0% | 1,989 | 2,410 | +21% | 0 | 0 | — |
case-25 | fail→pass | 7,642 | 2,675 | -65% | 1 | 1 | 0% | 1,065 | 1,673 | +57% | 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. 25 cases were attempted, and 18 counted toward the lift figure. The other 7 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 +52 percentage points is the difference between those two pass rates over the 18 comparable cases. 2 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.