← 返回 Skills 市场
187
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install a-share-multifactor-model
功能描述
A股多因子模型/Barra风格因子分析。当用户说"多因子"、"multifactor"、"Barra"、"因子模型"、"风格因子"、"XX的因子暴露"、"因子收益率"、"风险模型"时触发。基于 cn-stock-data 获取行情和财务数据,构建多因子风险模型,分析因子暴露、因子收益、协方差矩阵。支持研报风格(f...
使用说明 (SKILL.md)
A股多因子模型
数据源
SCRIPTS="$SKILLS_ROOT/cn-stock-data/scripts"
# 个股K线(计算动量/波动率因子)
python "$SCRIPTS/cn_stock_data.py" kline --code [CODE] --freq daily --start [日期]
# 实时行情(市值/PE/PB等)
python "$SCRIPTS/cn_stock_data.py" quote --code [CODE1],[CODE2],...
# 财务指标(ROE/营收增速等基本面因子)
python "$SCRIPTS/cn_stock_data.py" finance --code [CODE]
量化计算:
QSCRIPTS="$SKILLS_ROOT/a-share-multifactor-model/scripts"
# 多因子回归
python "$QSCRIPTS/multifactor_builder.py" --returns returns.csv --factors "size,value,momentum" --method ols
Workflow
Step 1: 确定因子体系
根据用户需求选择因子集:
- Barra CNE5 风格:Size/Beta/Momentum/ResidVol/NLSize/BP/Liquidity/EarningsYield/Growth/Leverage
- 自定义因子:用户指定的因子组合
- 通过 cn-stock-data 获取原始数据(行情+财务)
Step 2: 因子计算与标准化
- 从原始数据计算因子值
- 去极值(MAD 法 ±3 倍)
- 标准化(Z-score)
- 缺失值处理(行业均值填充)
Step 3: 截面回归估计因子收益
- 每期对股票收益 vs 因子暴露做 OLS 回归
- 回归系数即为因子收益率
- 计算因子收益的 t 统计量
Step 4: 构建风险模型
- 因子协方差矩阵(指数加权)
- 特质风险估计(回归残差的波动率)
- 股票层面的风险分解
Step 5: 输出
| 维度 | formal(完整因子报告) | brief(快速分析) |
|---|---|---|
| 因子定义 | 完整因子体系说明 | 仅列出因子名 |
| 因子收益 | 完整时序+统计检验 | 近期因子收益排名 |
| 暴露分析 | 个股因子暴露详表 | 关键因子暴露值 |
| 风险模型 | 协方差矩阵+特质风险 | 无 |
| 图表 | 因子收益累计曲线 | 无 |
默认风格:brief。用户要求"详细"/"完整模型"时切换为 formal。
关键规则
- 因子暴露需经行业和市值中性化处理
- 因子协方差使用半衰期 90 天的指数加权
- 特质收益率需检验正态性假设
- A 股需剔除 ST 股和次新股(上市\x3C60日)
- 行业分类默认使用申万一级(31 个行业)
安全使用建议
This skill appears to do what it says: run local data-prep scripts and compute factor returns and covariances. Before installing, verify the following: 1) Confirm the referenced cn-stock-data scripts (under $SKILLS_ROOT/cn-stock-data) are trustworthy and inspect them for any network calls or credential usage, since SKILL.md assumes that dependency but doesn't declare it. 2) Ensure the CSV inputs you supply do not contain sensitive data you don't want processed. 3) Make sure required Python packages (pandas, numpy) are available in the environment. 4) Run the included multifactor_builder.py on test data in an isolated environment first to confirm outputs and that no unexpected I/O or network activity occurs.
功能分析
Type: OpenClaw Skill
Name: a-share-multifactor-model
Version: 1.0.0
The skill is a legitimate quantitative finance tool for A-share multi-factor modeling and Barra style factor analysis. The Python script `scripts/multifactor_builder.py` implements standard statistical methods like WLS regression, MAD winsorization, and EWMA covariance for financial data processing without any network or unauthorized file access. The instructions in `SKILL.md` and the documentation are well-aligned with the stated purpose and contain no evidence of malicious intent or prompt injection.
能力评估
Purpose & Capability
Name/description match the included assets: SKILL.md explains workflows for factor construction and the repository includes a multifactor_builder.py that implements cross-sectional regression, factor statistics, and EWMA covariance. No unrelated binaries, credentials, or config paths are requested.
Instruction Scope
Runtime instructions tell the agent to invoke cn-stock-data scripts under $SKILLS_ROOT and then run the local multifactor_builder.py. This is consistent with the described workflow, but the SKILL.md assumes the presence of a separate cn-stock-data skill at $SKILLS_ROOT (not declared as a dependency here). The instructions do not read arbitrary system files or exfiltrate data to external endpoints.
Install Mechanism
No install spec is provided (instruction-only with one helper script). No external downloads or package installs are invoked by the skill itself.
Credentials
The skill declares no required environment variables or credentials. The code reads CSV inputs (returns/exposures) and performs local numeric computations; it does not request tokens, secrets, or unrelated environment access.
Persistence & Privilege
always is false and the skill does not modify agent configuration or request permanent presence. It runs as-needed and prints results to stdout; no privileged persistence behavior is present.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install a-share-multifactor-model - 安装完成后,直接呼叫该 Skill 的名称或使用
/a-share-multifactor-model触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of the A股多因子模型 skill:
- Supports Barra风格与自定义因子的多因子模型分析,自动触发关键词包括“多因子”、“Barra”、“因子模型”等。
- 集成 cn-stock-data 获取A股行情与财务数据,自动构建因子、因子暴露、收益及协方差。
- 支持formal(研报)和brief(快速)两种报告风格,按用户需求切换输出细节。
- 实现因子标准化、去极值、缺失值处理,以及行业/市值中性化处理。
- 风险模型支持因子协方差(指数加权90天)、特质风险及股票分解分析。
- 默认剔除ST及上市不足60日新股,行业分类采用申万一级。
元数据
常见问题
A Share Multifactor Model 是什么?
A股多因子模型/Barra风格因子分析。当用户说"多因子"、"multifactor"、"Barra"、"因子模型"、"风格因子"、"XX的因子暴露"、"因子收益率"、"风险模型"时触发。基于 cn-stock-data 获取行情和财务数据,构建多因子风险模型,分析因子暴露、因子收益、协方差矩阵。支持研报风格(f... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 187 次。
如何安装 A Share Multifactor Model?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install a-share-multifactor-model」即可一键安装,无需额外配置。
A Share Multifactor Model 是免费的吗?
是的,A Share Multifactor Model 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
A Share Multifactor Model 支持哪些平台?
A Share Multifactor Model 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 A Share Multifactor Model?
由 yzswk(@yzswk)开发并维护,当前版本 v1.0.0。
推荐 Skills