Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By quantskillsGPL-3.0In 1 marketplace
Computes Alpha101, Alpha158 and Alpha191 factor values from long-form daily OHLCV CSV into a wide factor table for A-share research. Says it makes no LLM calls and reads no API key, and missing inputs skip factors instead of stopping the run.
Trending plugins
7-day copy clicks
Claude hands work to one, or you mention it with @.
Of the plugin's README
Chinese
1 marketplace, most starred first
alpha101, alpha191, alpha158, quantitative-finance, factor-computation, ohlcv, stock-factors, csv
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
简体中文 | English
Alpha101 + Alpha158 + Alpha191 经典因子库:从长表 OHLCV CSV 批量计算每日因子值,输出宽表因子 CSV。
skill-factor-alpha191-alpha101 是一个经典公式因子库 Skill,用于计算参考自 JoinQuant 公式的 Alpha101/Alpha191,以及参考 Microsoft Qlib Alpha158 定义的因子值。
这个仓库适合用于研究:
本仓库只负责计算因子值,不调用 LLM,不读取 API key,也不输出 IC、ICIR、回测收益或交易建议。
本仓库包含三套公式因子库:
| 因子库 | 范围 | 输出文件 | 说明 |
|---|---|---|---|
| Alpha101 | alpha_001 到 alpha_101 | alpha101_values.csv | 参考 JoinQuant Alpha101 的公式 |
| Alpha158 | alpha158.<name>.<variant> | alpha158_values.csv | 参考 Microsoft Qlib Alpha158 定义实现的 158 个因子(由 42 个原生模块展开,含窗口变体) |
| Alpha191 | alpha_001 到 alpha_191 | alpha191_values.csv | 参考 JoinQuant Alpha191 的公式 |
Alpha101 和 Alpha191 公式从本地 compute_alpha101_skill.py 和 compute_alpha191_skill.py 迁移,并根据 JoinQuant 提供的因子值 API 做过修正。Alpha158 按 Microsoft Qlib 的 Alpha158DL 特征定义实现为内置原生模块,运行时不依赖 Qlib 安装。
部分公式依赖行业、市值、基准指数或其他输入。当前数据不足时,相关因子不会终止整个任务,而是记录到 skipped_factors.json。
skill-factor-alpha191-alpha101/
├── SKILL.md
├── README.md
├── README.en.md
├── agents/
│ └── openai.yaml
├── examples/
│ ├── compute_input.json
│ └── toy_market_data.csv
├── references/
│ ├── input_schema.md
│ ├── output_contract.md
│ ├── source_boundary.md
│ └── validation_notes.md
└── scripts/
├── compute_alpha_factors.py
└── alpha_runtime/
├── alpha101_formulas.py
├── alpha158_formulas.py
├── alpha158_native/
├── alpha191_formulas.py
├── alpha_compute.py
├── data.py
├── runtime.py
└── selector.py
第一版只支持长表 CSV。每一行是一只股票在一个交易日的行情记录。
必需字段:
date, symbol, open, high, low, close, volume
可选字段:
amount, vwap, adjfactor, pre_close, limit_up, limit_down
处理规则:
| 字段/规则 | 说明 |
|---|---|
date | 支持 YYYYMMDD 或 YYYY-MM-DD,运行时会标准化为 YYYYMMDD |
symbol | 按字符串处理 |
vwap 缺失 | 若有 amount 和 volume,用 amount / volume 推导 |
amount 缺失 | 用 close * volume 近似 |
adjfactor 存在 | 价格字段会转换为未复权口径后再计算 |
benchmark_csv_path | 可选;用于 Alpha191 中需要基准指数的公式 |
安装依赖:
pip install -r requirements.txt
运行示例配置:
python scripts/compute_alpha_factors.py --input examples/compute_input.json
指定输出目录:
python scripts/compute_alpha_factors.py --input examples/compute_input.json --output outputs/my_alpha_run
--output 会覆盖 JSON 中的 output_dir。
示例见 examples/compute_input.json。
{
"market_data_csv_path": "toy_market_data.csv",
"output_dir": "outputs/alpha_compute_example",
"alpha_sets": ["alpha101", "alpha191"],
"alpha_names": [
"alpha101:alpha_001",
"alpha101:alpha_002",
"alpha191:alpha_001",
"alpha191:alpha_018"
],
"exclude_alpha_names": [],
"start_date": "",
"end_date": "",
"symbols": [],
"output_format": "csv",
"output_layout": "wide",
"n_jobs": 1,
"show_progress": true
}
核心字段:
| 字段 | 类型 | 说明 |
|---|---|---|
market_data_csv_path | string | 长表行情 CSV 路径。相对路径依次按输入 JSON 目录、Skill 根目录、examples/ 解析 |
benchmark_csv_path | string | 可选基准指数 CSV,字段至少包含 date,并包含 close 或 open |
output_dir | string | 输出目录。JSON 内相对路径按 Skill 根目录解析 |
alpha_sets | list/string | 可选 alpha101、alpha158、alpha191 或任意组合;为空表示三套都计算 |
alpha_names | list/string | 为空表示计算所选库全部因子;Alpha101/191 支持 alpha_001、1、alpha101:alpha_001,Alpha158 使用 alpha158.ma.p5 |
exclude_alpha_names | list/string | 在选择后排除指定因子,支持带库名前缀 |
start_date / end_date | string | 可选日期过滤,闭区间 |
symbols | list[string] | 可选股票池过滤,空列表表示全部股票 |
n_jobs | integer | 并行 worker 数;缺省时使用机器逻辑 CPU 数 |
show_progress | bool | 是否打印进度条 |
output_format 和 output_layout 当前只作为示例说明字段保留。实际代码固定输出 CSV 宽表;修改这两个字段不会改变输出格式。
只计算 Alpha101:
{
"alpha_sets": ["alpha101"],
"alpha_names": []
}
只计算 Alpha191:
{
"alpha_sets": ["alpha191"],
"alpha_names": []
}
只计算 Alpha158:
{
"alpha_sets": ["alpha158"],
"alpha_names": ["alpha158.ma.p5", "alpha158.vwap0.base"]
}
同时计算两套库的指定因子:
{
"alpha_sets": ["alpha101", "alpha191"],
"alpha_names": ["alpha101:alpha_001", "alpha191:alpha_018"]
}
排除指定因子:
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
factor-alpha191-alpha101@quantskills is listed by quantskills/registry — review the source before installing
npx claudepluginhub quantskills/registry --plugin factor-alpha191-alpha101Plugins from other owners that cover similar ground