Home/Finance & Investment/backtesting-frameworks
B

backtesting-frameworks

by @wshobsonv
4.6(120)

Build robust, production-grade backtesting systems for trading strategies, effectively handling common pitfalls like look-ahead bias, survivorship bias, and transaction costs. This skill is crucial for developing trading algorithms, validating strategy performance, and establishing reliable backtesting infrastructure, ensuring accurate and trustworthy strategy evaluations.

backtestingtradingstrategiesalgorithmic-tradingquantitative-financeGitHub
Installation
npx skills add https://github.com/wshobson/agents --skill backtesting-frameworks
compare_arrows

Before / After Comparison

1 组
Before

Traditional backtesting methods often suffer from issues like look-ahead bias and survivorship bias, leading to many strategies being falsely identified as profitable, wasting valuable development and deployment resources.

After

Utilizing backtesting systems built with this skill effectively identifies and mitigates common biases, significantly reducing the rate of falsely identified profitable strategies and ensuring accurate and reliable strategy evaluation.

SKILL.md

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

BiasDescriptionMitigation
Look-aheadUsing future informationPoint-in-time data
SurvivorshipOnly testing on survivorsUse delisted securities
OverfittingCurve-fitting to historyOut-of-sample testing
SelectionCherry-picking strategiesPre-registration
TransactionIgnoring trading costsRealistic 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

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs16.6K
Rating4.6 / 5.0
Version
Updated2026年10月22日
Comparisons1

User Rating

4.6(120)
5
37%
4
43%
3
13%
2
5%
1
2%

Rate this Skill

0.0

Compatible Platforms

🤖claude-code

Timeline

Created2026年5月29日
Last Updated2026年10月22日
🎁 Agent Knowledge Cards
Survey