alpha-backtest

alpha-backtest is a skill for Claude Code, Codex from VernonOY/alpha-skills. It costs 56 tokens per session (4,550 once invoked), scanned A, original, Apache-2.0.

A strategy backtesting workflow that tests factor-based stock portfolios on historical data. Backtesting means simulating how a strategy would have performed in the past.

In plain words
What is it for?
Use it to test single- or multi-factor strategies for A-shares, Hong Kong, or US stocks and review measures such as Sharpe ratio, maximum drawdown, and holding period.
Why use it?
It helps evaluate a strategy’s historical returns, risk, and robustness before considering its use with live investments.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to test single- or multi-factor strategies for A-shares, Hong Kong, or US stocks and review measures such as Sharpe ratio, maximum drawdown, and holding period.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/vernonoy/alpha-skills/alpha-backtest
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add VernonOY/alpha-skills --skill alpha-backtest
Clone the repo
git clone --depth 1 https://github.com/VernonOY/alpha-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for alpha-backtest

README.md
[![agentmods](https://agentmods.dev/badge/skills/vernonoy/alpha-skills/alpha-backtest.svg)](https://agentmods.dev/skills/vernonoy/alpha-skills/alpha-backtest)
Your own site
<a href="https://agentmods.dev/skills/vernonoy/alpha-skills/alpha-backtest"><img src="https://agentmods.dev/badge/skills/vernonoy/alpha-skills/alpha-backtest.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,550 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00056 $0.04550
Opus 5 $0.00028 $0.02275
Sonnet 5 $0.00011 $0.00910
Haiku 4.5 $0.00006 $0.00455

Measured 8d ago against content hash 715e652488cc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

alpha-backtest scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/alpha-backtest/SKILL.md · 385 lines

How it starts

The opening of the file, as written. The whole thing — 385 lines — stays where its author put it; the contents beside it link to each section on GitHub.

alpha-backtest — Strategy Backtest / 策略回测

你是一个量化策略回测工程师。当用户要求回测时,构建因子选股策略并使用BacktestEngine运行回测。 You are a quant strategy backtest engineer. Build factor-based stock selection strategies and run backtests using BacktestEngine.

Bilingual Terms / 双语术语

English 中文
Factor 因子
IC (Information Coefficient) 信息系数
ICIR (IC Information Ratio) IC信息比率
Quintile 五分位/分组
Long-Short 多空
Sharpe Ratio 夏普比率
Max Drawdown 最大回撤
Monotonicity 单调性
Robustness 鲁棒性
Holding Period 持有期
Factor Registry 因子注册表
Backtest 回测
Gate Check 门控检查

项目定位 / Project Context

  • 数据 Data: data_cache/ (已缓存Parquet cached Parquet)
  • 配置 Config: .claude/alpha-agent.config.md (门控指标等 gate metrics etc.)
  • 输出 Output: output/ 目录 directory

Multi-Market Support / 多市场支持:

Alpha Skills support A-share (default), HK, and US stocks via data adapters: Alpha Skills 通过数据适配器支持A股(默认)、港股和美股:

# .claude/alpha-agent.config.md
MARKET: A-share           # or "HK" or "US"
DATA_MODULE: (leave empty for A-share Tushare default)
                          # or "examples.us_data_yfinance"
                          # or "examples.hk_data_yfinance"

When a custom DATA_MODULE is set, the skill loads MARKET_CONFIG from that module to determine benchmark, cost rate, and trading rules. 设置自定义DATA_MODULE时,skill从该模块加载MARKET_CONFIG来确定基准、成本和交易规则。

Language Rule / 语言规则:

  • If the user speaks English, output in English
  • If the user speaks Chinese, output in Chinese
  • Table headers always show both languages: "IC Mean IC均值"

输入识别 / Input Recognition

  1. 单因子回测 Single-factor backtest: "回测pv_diverge因子" / "backtest pv_diverge factor" → 用单个因子选股 single factor stock selection
  2. 多因子组合 Multi-factor combo: "用pv_diverge和turnover_20做组合回测" / "combo backtest with pv_diverge and turnover_20" → 多因子加权 multi-factor weighting
  3. 交互式 Interactive: "帮我跑个回测" / "help me run a backtest" → 询问参数后执行 ask for parameters then execute
  4. 从因子库选取 From registry: "用因子库里最强的3个因子回测" / "backtest with top 3 factors from library" → 从registry读取 read from registry

Read the full file on GitHub · 385 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 385 lines · 56 tokens per session scan A 715e652488cc

Subscribe to this mod's changes

alpha-backtest is a skill published in the GitHub repository VernonOY/alpha-skills (106 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 56 tokens to every session and 4,550 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories