backtesting-frameworks — Claude Code skill for strategy backtests
Helps build trading strategy backtests that account for look-ahead and survivorship bias, plus transaction costs. Use it when developing or validating a trading algorithm.
/plugin marketplace add wshobson/agents
/plugin install quantitative-trading@claude-code-workflowsWhat backtesting-frameworks does
The skill outlines how to split historical data into training, validation, and test sets, then apply walk-forward analysis. It covers look-ahead bias, survivorship bias, overfitting, strategy selection, and ignored trading costs. Suggested safeguards include point-in-time data, delisted securities, and realistic cost models.
It also recommends out-of-sample testing, Monte Carlo analysis, and pre-registration. Worked examples are in references/details.md. Install it when you are building or checking a trading strategy backtest; it adds little to projects without that work.
What it helps with
- test a strategy on data kept out of training
- include trading costs in performance estimates
- avoid using future information in a backtest
- compare strategy variants with walk-forward analysis
Example prompts for the agent
- Review my strategy backtest for look-ahead bias and suggest how to prevent it.
- Split the historical data into training, validation, and test sets for this strategy.
- Add transaction costs and delisted securities to the backtest assumptions.
How to install backtesting-frameworks
1Plugin marketplace
/plugin marketplace add wshobson/agents/plugin install quantitative-trading@claude-code-workflowsThis installs the whole quantitative-trading plugin with all its skills
2Skills CLI (Vercel)
npx skills add wshobson/agents --skill backtesting-frameworks -a claude-code3Manually: put the files in place
~/.claude/skills/backtesting-frameworks/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/backtesting-frameworks/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill backtesting-frameworks -a codex2Manually: put the files in place
.agents/skills/backtesting-frameworks/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add wshobson/agents --skill backtesting-frameworks -a cursor2Manually: put the files in place
.cursor/skills/backtesting-frameworks/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install wshobson/agents backtesting-frameworks2Manually: put the files in place
.github/skills/backtesting-frameworks/SKILL.mdPlatform CLI
gemini skills install https://github.com/wshobson/agents --path plugins/quantitative-trading/skills/backtesting-frameworksManually: put the files in place
.devin/skills/backtesting-frameworks/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set213
The whole set →Similar
Questions about backtesting-frameworks
How do I install backtesting-frameworks in Claude Code?
Run npx skills add wshobson/agents --skill backtesting-frameworks -a claude-code to install it as a skill. The plugin commands are /plugin marketplace add wshobson/agents and /plugin install quantitative-trading@claude-code-workflows.
What does backtesting-frameworks do?
It guides the design of trading strategy backtests, with attention to common biases, transaction costs, and data splits. It also covers walk-forward and Monte Carlo analysis.
How does the skill recommend testing a strategy across time periods?
It describes walk-forward analysis, moving training and test windows forward through time. It also recommends keeping a test set for the final performance evaluation.
Source text
SKILL.md · MIT
---
name: backtesting-frameworks
description: Build robust backtesting systems for trading strategies with proper handling of look-ahead bias, survivorship bias, and transaction costs. Use when developing trading algorithms, validating strategies, or building backtesting infrastructure.
---
# Backtesting Frameworks
Build robust, production-grade backtesting systems that avoid common pitfalls and produce reliable strategy performance estimates.
## When to Use This Skill
- Developing trading strategy backtests
- Building backtesting infrastructure
- Validating strategy performance
- Avoiding common backtesting biases
- Implementing walk-forward analysis
- Comparing strategy alternatives
## Core Concepts
### 1. Backtesting Biases
| Bias | Description | Mitigation |
| ---------------- | ------------------------- | ----------------------- |
| **Look-ahead** | Using future information | Point-in-time data |
| **Survivorship** | Only testing on survivors | Use delisted securities |
| **Overfitting** | Curve-fitting to history | Out-of-sample testing |
| **Selection** | Cherry-picking strategies | Pre-registration |
| **Transaction** | Ignoring trading costs | Realistic cost models |
### 2. Proper Backtest Structure
```
Historical Data
│
▼
┌─────────────────────────────────────────┐
│ Training Set │
│ (Strategy Development & Optimization) │
└─────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Validation Set │
│ (Parameter Selection, No Peeking) │
└─────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ Test Set │
│ (Final Performance Evaluation) │
└─────────────────────────────────────────┘
```
### 3. Walk-Forward Analysis
```
Window 1: [Train──────][Test]
Window 2: [Train──────][Test]
Window 3: [Train──────][Test]
Window 4: [Train──────][Test]
─────▶ Time
```
## Detailed worked examples and patterns
Detailed sections (starting with `## Implementation Patterns`) live in `references/details.md`. Read that file when the navigation summary above is insufficient.
## Best Practices
### Do's
- **Use point-in-time data** - Avoid look-ahead bias
- **Include transaction costs** - Realistic estimates
- **Test out-of-sample** - Always reserve data
- **Use walk-forward** - Not just train/test
- **Monte Carlo analysis** - Understand uncertainty
### Don'ts
- **Don't overfit** - Limit parameters
- **Don't ignore survivorship** - Include delisted
- **Don't use adjusted data carelessly** - Understand adjustments
- **Don't optimize on full history** - Reserve test set
- **Don't ignore capacity** - Market impact matters
© Seth Hobson · MIT · wshobson/agents