smithery.ai

factor-backtest-skill

安?

First seen Apr 19, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,911 B
  • docs SUMMARY.md 129 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

因子回测 Skill

📌 用途

当你有 8 个 Alpha 表达式需要批量回测时,使用此技能。它会:

  • ✅ 验证表达式的合法性
  • ✅ 提交批量回测任务
  • ✅ 监控进度并处理异常
  • ✅ 返回完整的回测结果

🔑 核心约束(不可违反)

1. Rule of 8

  • 必须恰好传入 8 个表达式
  • 少于或多于 8 个都会被平台拒绝

2. 加速配置

  • 必须设置 visualization=false(大幅加速回测)

3. 中性化选择

neutralization 必须从以下 5 项中选一:

值 适用场景
SLOW 适用于低换手率信号(<50%年化)、长期趋势捕捉、基本面或价值策略
FAST 适用于高换手率信号(>70%年化)、短期趋势捕捉、高频数据或短期价格动量策略
SLOWANDFAST 适用于同时考虑短期和长期趋势的策略、多元化Alpha组合、平衡型投资策略
REVERSIONANDMOMENTUM 适用于需要对冲短期均值回归和长期动量的策略、平衡型多空Alpha因子
CROWDING 适用于希望降低拥挤交易风险的策略、强动量市场环境、流行因子或拥挤交易策略

🔄 标准流程(4 步)

步骤 1:验证表达式

mcp:validatealphaexpressions([表达式1, ..., 表达式8])

  • 要求:必须 100% 通过验证
  • 失败处理:修正错误 → 重新验证 → 严禁未全部通过就进入回测

步骤 2:提交回测

mcp: createmultiSim( alphaexpressions=[表达式1, ..., 表达式8], ... )

步骤 3:监控进度

mcp: checkmultisimulationstatus()

监控策略:

  • ⏱️ 回测时间较长,可每 5–10 分钟查询一次
  • 🚨 僵尸回测熔断:超过 40 分钟仍 in_progress → 放弃当前任务,重新提交

步骤 4:获取结果

mcp: getmultisimulationresult()


⚠️ 异常处理

语法错误

现象:回测返回 "No alpha ID found in completed simulation"

处理:

  1. 调用 getSimErrordetail 查看详细错误
  2. 对照 get_operators 检查操作符签名
  3. 修正表达式 → 重新走完整验证流程
  4. ❌ 严禁无修改直接重试

回测卡死

现象:状态持续 in_progress 超过 40 分钟

处理:

  1. 重新认证会话
  2. 再次检查状态
  3. 若仍卡死 → 放弃当前任务,创建新回测

🚫 禁止操作

  • ❌ 传入非 8 个表达式
  • ❌ 使用 neutralization 列表外的值
  • ❌ 设置 visualization=true
  • ❌ 语法错误后无修改重试
  • ❌ 高频轮询状态(< 5 分钟)

📊 输入/输出

输入

{
    "alpha_expressions": [8 个表达式],
    "decay": 5,                          # 可选
    "neutralization": "SLOW",            # 必须从 5 项中选
    "truncation": 0.0,                   # 可选
    "test_period": "P0Y0M"               # 可选
}

输出

{
    "location": "multiSim 结果 URL",
    "alphas": [
        {
            "alpha_id": "...",
            "sharpe": 1.8,
            "fitness": 1.2,
            "turnover": 0.25,
            "ic": 0.05
        },
        ...
    ],
    "status": "completed" | "failed",
    "errors": []
}

🛠️ 常用 MCP 工具

核心:

  • validatealphaexpressions - 验证表达式
  • create_multiSim - 批量回测
  • checkmultisimulationstatus - 检查状态
  • getmultisimulationresult - 获取结果

分析:

  • getalphadetails - 详细指标
  • getalphapnl - 收益曲线
  • getalphayearly_stats - 年度统计
  • check_correlation - 相关性检查

调试:

  • getSimErrordetail - 错误详情
  • get_operators - 操作符列表