Build robust backtesting systems for trading strategies
Backtesting frameworks

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…
--- 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
Overview
Build robust, production-grade backtesting systems that avoid common pitfalls and produce reliable strategy performance estimates.
Manual install (npx, ZIP)
Claude Code
npx skills add wshobson/agents --skill backtesting-frameworks -g -a claude-codeClaude Code (manual)
mkdir -p ~/.claude/skills && curl -sL https://codeload.github.com/wshobson/agents/tar.gz/4236bb91f839 \
| tar -xz -C ~/.claude/skills --strip-components=4 agents-4236bb91f839/plugins/quantitative-trading/skills/backtesting-frameworksWindows (PowerShell)
New-Item -ItemType Directory -Force "$HOME\.claude\skills" | Out-Null; Invoke-WebRequest "https://m.agentalley.io/zip/4eec2f26551cb1ea2ac0/backtesting-frameworks.zip" -OutFile "$env:TEMP\backtesting-frameworks.zip"; Expand-Archive "$env:TEMP\backtesting-frameworks.zip" -DestinationPath "$HOME\.claude\skills" -ForceClaude.ai / desktop
Codex, Cursor, other agents
Connects with Agent Alley MCP · agentalley.io/mcp
Files included
SKILL.md3.4 KBreferences/1 file · 17.8 KB
Read the files here
SKILL.md
Show the full text86 lines
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
| 1 | |
| 2 | name backtesting-frameworks |
| 3 | 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. |
| 4 | |
| 5 | |
| 6 | # Backtesting Frameworks |
| 7 | |
| 8 | Build robust, production-grade backtesting systems that avoid common pitfalls and produce reliable strategy performance estimates. |
| 9 | |
| 10 | ## When to Use This Skill |
| 11 | |
| 12 | Developing trading strategy backtests |
| 13 | Building backtesting infrastructure |
| 14 | Validating strategy performance |
| 15 | Avoiding common backtesting biases |
| 16 | Implementing walk-forward analysis |
| 17 | Comparing strategy alternatives |
| 18 | |
| 19 | ## Core Concepts |
| 20 | |
| 21 | ### 1. Backtesting Biases |
| 22 | |
| 23 | | Bias | Description | Mitigation | |
| 24 | | ---------------- | ------------------------- | ----------------------- | |
| 25 | | **Look-ahead** | Using future information | Point-in-time data | |
| 26 | | **Survivorship** | Only testing on survivors | Use delisted securities | |
| 27 | | **Overfitting** | Curve-fitting to history | Out-of-sample testing | |
| 28 | | **Selection** | Cherry-picking strategies | Pre-registration | |
| 29 | | **Transaction** | Ignoring trading costs | Realistic cost models | |
| 30 | |
| 31 | ### 2. Proper Backtest Structure |
| 32 | |
| 33 | |
| 34 | Historical Data |
| 35 | │ |
| 36 | ▼ |
| 37 | ┌─────────────────────────────────────────┐ |
| 38 | │ Training Set │ |
| 39 | │ (Strategy Development & Optimization) │ |
| 40 | └─────────────────────────────────────────┘ |
| 41 | │ |
| 42 | ▼ |
| 43 | ┌─────────────────────────────────────────┐ |
| 44 | │ Validation Set │ |
| 45 | │ (Parameter Selection, No Peeking) │ |
| 46 | └─────────────────────────────────────────┘ |
| 47 | │ |
| 48 | ▼ |
| 49 | ┌─────────────────────────────────────────┐ |
| 50 | │ Test Set │ |
| 51 | │ (Final Performance Evaluation) │ |
| 52 | └─────────────────────────────────────────┘ |
| 53 | |
| 54 | |
| 55 | ### 3. Walk-Forward Analysis |
| 56 | |
| 57 | |
| 58 | Window 1: [Train──────][Test] |
| 59 | Window 2: [Train──────][Test] |
| 60 | Window 3: [Train──────][Test] |
| 61 | Window 4: [Train──────][Test] |
| 62 | ─────▶ Time |
| 63 | |
| 64 | |
| 65 | ## Detailed worked examples and patterns |
| 66 | |
| 67 | Detailed sections (starting with `## Implementation Patterns`) live in `references/details.md`. Read that file when the navigation summary above is insufficient. |
| 68 | |
| 69 | ## Best Practices |
| 70 | |
| 71 | ### Do's |
| 72 | |
| 73 | **Use point-in-time data** - Avoid look-ahead bias |
| 74 | **Include transaction costs** - Realistic estimates |
| 75 | **Test out-of-sample** - Always reserve data |
| 76 | **Use walk-forward** - Not just train/test |
| 77 | **Monte Carlo analysis** - Understand uncertainty |
| 78 | |
| 79 | ### Don'ts |
| 80 | |
| 81 | **Don't overfit** - Limit parameters |
| 82 | **Don't ignore survivorship** - Include delisted |
| 83 | **Don't use adjusted data carelessly** - Understand adjustments |
| 84 | **Don't optimize on full history** - Reserve test set |
| 85 | **Don't ignore capacity** - Market impact matters |
| 86 |
Details
- Updated
- Sep 21, 2026
- License
- MIT
- Stars on the repo
- ★ 39,857
- Checked
- Source
- wshobson/agents ↗
- Creator
- wshobson · 179 listings
Similar skills
See all →
PromptAct as an expert AI engineer specializing in practical
SkillQuery the 1000 Genomes Project datasetOneKGPd: Individual-Level Queries over the 1000 Genomes Project
SkillBayesian modeling with PyMCPyMC Bayesian Modeling
SkillStatistical models library for PythonStatsmodels: Statistical Modeling and Econometrics
SkillHugging Face Transformers for loading Hub models
SkillWorking with Outpost Bio's open microbiome foundation modelsWaypoint: Outpost Bio's Open Microbiome Foundation ModelsMore from wshobson
SkillMaster C/.NET backend development patterns for building
SkillImplement WCAG 2.2 compliant interfaces with mobileAccessibility compliance
SkillMaster Material Design 3 and Jetpack Compose patternsAndroid Mobile Design
SkillMigrate from AngularJS to Angular using hybrid modeAngular migration
SkillUnderstand anti-reversing, obfuscationAnti reversing techniques
SkillBuild production Apache Airflow DAGs with best practicesApache Airflow DAG Patterns