← 返回 Skills 市场
lean-zhouchao

Backtest Expert Zc

作者 lean-zhouchao · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
189
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install backtest-expert-zc
功能描述
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies...
使用说明 (SKILL.md)

Backtest Expert

Systematic approach to backtesting trading strategies based on professional methodology that prioritizes robustness over optimistic results.

Core Philosophy

Goal: Find strategies that "break the least", not strategies that "profit the most" on paper.

Principle: Add friction, stress test assumptions, and see what survives. If a strategy holds up under pessimistic conditions, it's more likely to work in live trading.

When to Use This Skill

Use this skill when:

  • Developing or validating systematic trading strategies
  • Evaluating whether a trading idea is robust enough for live implementation
  • Troubleshooting why a backtest might be misleading
  • Learning proper backtesting methodology
  • Avoiding common pitfalls (curve-fitting, look-ahead bias, survivorship bias)
  • Assessing parameter sensitivity and regime dependence
  • Setting realistic expectations for slippage and execution costs

Backtesting Workflow

1. State the Hypothesis

Define the edge in one sentence.

Example: "Stocks that gap up >3% on earnings and pull back to previous day's close within first hour provide mean-reversion opportunity."

If you can't articulate the edge clearly, don't proceed to testing.

2. Codify Rules with Zero Discretion

Define with complete specificity:

  • Entry: Exact conditions, timing, price type
  • Exit: Stop loss, profit target, time-based exit
  • Position sizing: Fixed $$, % of portfolio, volatility-adjusted
  • Filters: Market cap, volume, sector, volatility conditions
  • Universe: What instruments are eligible

Critical: No subjective judgment allowed. Every decision must be rule-based and unambiguous.

3. Run Initial Backtest

Test over:

  • Minimum 5 years (preferably 10+)
  • Multiple market regimes (bull, bear, high/low volatility)
  • Realistic costs: Commissions + conservative slippage

Examine initial results for basic viability. If fundamentally broken, iterate on hypothesis.

4. Stress Test the Strategy

This is where 80% of testing time should be spent.

Parameter sensitivity:

  • Test stop loss at 50%, 75%, 100%, 125%, 150% of baseline
  • Test profit target at 80%, 90%, 100%, 110%, 120% of baseline
  • Vary entry/exit timing by ±15-30 minutes
  • Look for "plateaus" of stable performance, not narrow spikes

Execution friction:

  • Increase slippage to 1.5-2x typical estimates
  • Model worst-case fills (buy at ask+1 tick, sell at bid-1 tick)
  • Add realistic order rejection scenarios
  • Test with pessimistic commission structures

Time robustness:

  • Analyze year-by-year performance
  • Require positive expectancy in majority of years
  • Ensure strategy doesn't rely on 1-2 exceptional periods
  • Test in different market regimes separately

Sample size:

  • Absolute minimum: 30 trades
  • Preferred: 100+ trades
  • High confidence: 200+ trades

5. Out-of-Sample Validation

Walk-forward analysis:

  1. Optimize on training period (e.g., Year 1-3)
  2. Test on validation period (Year 4)
  3. Roll forward and repeat
  4. Compare in-sample vs out-of-sample performance

Warning signs:

  • Out-of-sample \x3C50% of in-sample performance
  • Need frequent parameter re-optimization
  • Parameters change dramatically between periods

6. Evaluate Results

Questions to answer:

  • Does edge survive pessimistic assumptions?
  • Is performance stable across parameter variations?
  • Does strategy work in multiple market regimes?
  • Is sample size sufficient for statistical confidence?
  • Are results realistic, not "too good to be true"?

Decision criteria:

  • Deploy: Survives all stress tests with acceptable performance
  • 🔄 Refine: Core logic sound but needs parameter adjustment
  • Abandon: Fails stress tests or relies on fragile assumptions

Key Testing Principles

Punish the Strategy

Add friction everywhere:

  • Commissions higher than reality
  • Slippage 1.5-2x typical
  • Worst-case fills
  • Order rejections
  • Partial fills

Rationale: Strategies that survive pessimistic assumptions often outperform in live trading.

Seek Plateaus, Not Peaks

Look for parameter ranges where performance is stable, not optimal values that create performance spikes.

Good: Strategy profitable with stop loss anywhere from 1.5% to 3.0% Bad: Strategy only works with stop loss at exactly 2.13%

Stable performance indicates genuine edge; narrow optima suggest curve-fitting.

Test All Cases, Not Cherry-Picked Examples

Wrong approach: Study hand-picked "market leaders" that worked Right approach: Test every stock that met criteria, including those that failed

Selective examples create survivorship bias and overestimate strategy quality.

Separate Idea Generation from Validation

Intuition: Useful for generating hypotheses Validation: Must be purely data-driven

Never let attachment to an idea influence interpretation of test results.

Common Failure Patterns

Recognize these patterns early to save time:

  1. Parameter sensitivity: Only works with exact parameter values
  2. Regime-specific: Great in some years, terrible in others
  3. Slippage sensitivity: Unprofitable when realistic costs added
  4. Small sample: Too few trades for statistical confidence
  5. Look-ahead bias: "Too good to be true" results
  6. Over-optimization: Many parameters, poor out-of-sample results

See references/failed_tests.md for detailed examples and diagnostic framework.

Available Reference Documentation

Methodology Reference

File: references/methodology.md

When to read: For detailed guidance on specific testing techniques.

Contents:

  • Stress testing methods
  • Parameter sensitivity analysis
  • Slippage and friction modeling
  • Sample size requirements
  • Market regime classification
  • Common biases and pitfalls (survivorship, look-ahead, curve-fitting, etc.)

Failed Tests Reference

File: references/failed_tests.md

When to read: When strategy fails tests, or learning from past mistakes.

Contents:

  • Why failures are valuable
  • Common failure patterns with examples
  • Case study documentation framework
  • Red flags checklist for evaluating backtests

Critical Reminders

Time allocation: Spend 20% generating ideas, 80% trying to break them.

Context-free requirement: If strategy requires "perfect context" to work, it's not robust enough for systematic trading.

Red flag: If backtest results look too good (>90% win rate, minimal drawdowns, perfect timing), audit carefully for look-ahead bias or data issues.

Tool limitations: Understand your backtesting platform's quirks (interpolation methods, handling of low liquidity, data alignment issues).

Statistical significance: Small edges require large sample sizes to prove. 5% edge per trade needs 100+ trades to distinguish from luck.

Discretionary vs Systematic Differences

This skill focuses on systematic/quantitative backtesting where:

  • All rules are codified in advance
  • No discretion or "feel" in execution
  • Testing happens on all historical examples, not cherry-picked cases
  • Context (news, macro) is deliberately stripped out

Discretionary traders study differently—this skill may not apply to setups requiring subjective judgment.

安全使用建议
This skill appears to be a benign instruction-only backtesting methodology reference. Before installing or relying on it: (1) note the package metadata mismatch (the included _meta.json differs from the registry metadata), which suggests packaging/versioning sloppiness — not necessarily malicious but worth verifying the source; (2) because the skill is guidance-only, it won't run code, but if you paste proprietary datasets or credentials into conversations while following its advice, treat that input as sensitive — do not share live API keys or private data; (3) validate any specific numerical assumptions (slippage, sample-size thresholds) against your instruments/data provider before applying them in live or automated systems; (4) if you plan to implement automated backtests based on this guidance, use survivorship-free, properly timestamped data and sandboxed environments, and audit any code you write or third-party libraries you install.
功能分析
Type: OpenClaw Skill Name: backtest-expert-zc Version: 1.0.0 The skill bundle 'backtest-expert-zc' is purely instructional and provides a comprehensive framework for systematic backtesting of trading strategies. It contains no executable code, system commands, or network requests. The content in SKILL.md and the reference files (failed_tests.md, methodology.md) focuses entirely on educational methodology, stress testing, and bias prevention in quantitative trading, with no evidence of malicious intent or prompt injection risks.
能力评估
Purpose & Capability
Name and description match the actual content: the skill is a methodological guide for systematic backtesting. There are no declared binaries, env vars, config paths, or primary credentials that would be unexpected for an instruction-only methodology skill.
Instruction Scope
SKILL.md contains procedural guidance, checklists, and test frameworks only. It does not instruct the agent to read local files, access credentials, call external endpoints, or exfiltrate data. The instructions stay within the stated domain of backtesting methodology.
Install Mechanism
No install spec and no code files to install. This is lowest-risk: nothing is written to disk or fetched at install time.
Credentials
No required environment variables, credentials, or config paths are declared. The guidance does not reference hidden environment variables or external secrets.
Persistence & Privilege
Skill flags are default (always: false, agent invocation enabled) and appropriate for an advisory skill. The skill does not request persistent system presence or modification of other skill configurations.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install backtest-expert-zc
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /backtest-expert-zc 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of backtest-expert-zc, providing expert guidance for systematic backtesting of trading strategies. - Covers robust professional methodology: stress-testing, parameter sensitivity, realistic slippage modeling, and bias prevention. - Includes workflow and best practices for developing, validating, and troubleshooting trading strategies. - Emphasizes warning signs and common failure patterns to avoid overfitting and misleading results. - Offers reference documentation for detailed methodology and failure case studies.
元数据
Slug backtest-expert-zc
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Backtest Expert Zc 是什么?

Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 189 次。

如何安装 Backtest Expert Zc?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install backtest-expert-zc」即可一键安装,无需额外配置。

Backtest Expert Zc 是免费的吗?

是的,Backtest Expert Zc 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Backtest Expert Zc 支持哪些平台?

Backtest Expert Zc 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Backtest Expert Zc?

由 lean-zhouchao(@lean-zhouchao)开发并维护,当前版本 v1.0.0。

💬 留言讨论