Skills · Data & AI

Backtesting Frameworks

Unverified30/40

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.

Originally by wshobson · MIT

Claude CodePartialHas SKILL.md but declares no allowed-tools — Claude Code will ask for permission each time
CursorPartialPlain prose you can paste in — but no Cursor rules file
CodexPartialPlain prose you can paste in — but no AGENTS.md
Gemini CLIPartialPlain prose you can paste in
CopilotPartialPlain prose you can paste in — but no Copilot instructions file
npx agentalley add backtesting-frameworks

This command does not work yet — the CLI is still being built. Until then, use Raw in the reader below to take the file.

Who is stuck, and on what

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.

The whole source

No sign-in, no blur, nothing truncated
backtesting-frameworks/SKILL.md86 lines3.4 KBRawView on GitHub
Frontmatter — 2 properties
namebacktesting-frameworks
descriptionBuild 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.
1---
2name: backtesting-frameworks
3description: 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---A5No allowed-tools declared — no way to tell what this skill may touch
5 
6# Backtesting Frameworks
7 
8Build 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```
34Historical 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```
58Window 1: [Train──────][Test]
59Window 2: [Train──────][Test]
60Window 3: [Train──────][Test]
61Window 4: [Train──────][Test]
62 ─────▶ Time
63```
64 
65## Detailed worked examples and patterns
66 
67Detailed 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 

Reviews

Installed this one?Write the first review and take the Trailblazer badge.

Reviews only open after a real install, so this is empty — and we leave it empty rather than invent one.

Alternatives

Also in Data & AI