backtesting-frameworks Skill (wshobson): Trading Backtests
Guides your agent to build trading-strategy backtests that avoid common bias, with Python code patterns to start from.
- Installs
- 17.2K
- on skills.sh
- Stars
- 42.1K
- on GitHub
- Files
- 1
- besides SKILL.md
- Updated
- Oct 2026
- last repo commit
backtesting-frameworks teaches the agent what makes a backtest believable. It lists five biases (look-ahead, survivorship, overfitting, selection and transaction costs) with a fix for each. It also shows a train, validation and test split and walk-forward windows, then points to a reference file for code.
references/details.md holds four Python patterns (event-driven backtester, vectorized backtester, walk-forward optimization, Monte Carlo analysis) and a performance-metrics function, using pandas and numpy. The skill bundles no scripts.
Good for
- Developers building backtesting code for trading strategies
- Quant hobbyists checking whether a strategy test is honest
- Anyone reviewing a backtest for look-ahead, survivorship or overfitting bias
Install backtesting-frameworks
Claude Code
- 1
Copy this prompt.
Install the backtesting-frameworks skill in Claude Code. Run this command: npx skills add https://github.com/wshobson/agents --skill backtesting-frameworks Then check that it loaded and tell me how to use it.
- 2
Paste it into Claude Code. It shows the change and asks before running it.
Requires Node.js.
From its listing on skills.sh. Source.
What's in the skill
When it loads
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.
Sections in SKILL.md
- When to Use This Skill
- Core Concepts
- 1. Backtesting Biases
- 2. Proper Backtest Structure
- 3. Walk-Forward Analysis
- Detailed worked examples and patterns
- Best Practices
- Do's
- Don'ts
Key facts
- Author
- wshobson
- Repo
- wshobson/agents
- License
- MIT (as listed by the crawl)
- Installs on skills.sh
- 17,161 (Nov 2, 2026)
- GitHub stars
- 42,081 (repo, Nov 2, 2026)
- Last commit
- 2026-10-30
- Part of plugin
- quantitative-trading, in the wshobson/agents collection
What it includes
Look-ahead, survivorship, overfitting, selection and cost bias, each with a fix
Fixes include point-in-time data, delisted securities, out-of-sample tests and realistic cost models.
Backtesting biasesTraining, validation and test sets, with no peeking at the test set
Parameters are chosen on validation data and final results come from the test set.
Proper backtest structureRolling train and test windows moving through time
Used instead of one single train and test split.
Walk-forward analysisPoint-in-time data, costs included, out-of-sample tests, Monte Carlo analysis
The don'ts include optimising on full history and ignoring capacity or market impact.
Best practicesPython pattern using abstract classes, dataclasses and a portfolio with Decimal cash
Starts from 100,000 initial capital in the example.
Event-driven backtester (details.md)Fast pandas pattern that turns a signal into an equity curve
Example call uses a 50-period momentum signal.
Vectorized backtester (details.md)Parameter search per window, tested on the following window
Uses itertools.product for the parameter grid.
Walk-forward optimization (details.md)Resamples returns to show the range of outcomes
Helps judge how much of a result is luck.
Monte Carlo analysis (details.md)calculate_metrics function with a default 2% risk-free rate
Returns a dictionary of performance numbers.
Performance metrics (details.md)
From the official docs
Questions
What does the backtesting-frameworks skill do?
It guides the agent to build trading backtests that avoid the usual traps: using future data, testing only on surviving securities, overfitting and ignoring costs. It also supplies Python patterns to start from.
How do I install it?
Use the install box above. Copy the whole folder, because the code patterns are in references/details.md. The wshobson/agents README also lists plugin routes.
Does it work in Claude Code, Codex and Cursor?
The repo README says its collection works across Claude Code, OpenAI Codex CLI, Cursor, OpenCode, Antigravity CLI, GitHub Copilot and Pi. It does not give a separate list for this skill.
Does it include market data or connect to a broker?
The reference code takes price data you supply as pandas objects. Its imports are pandas, numpy and the Python standard library.
Will it tell me a strategy will be profitable?
No. SKILL.md is about building a fairer test: bias checks, out-of-sample data, walk-forward windows and costs. Our note: even a clean backtest does not guarantee future returns, and this page is not financial advice.
Do I need an API key?
No key is mentioned and the skill bundles no scripts. The example code assumes Python with pandas and numpy.
Is it safe?
It is Markdown guidance plus Python example code that simulates orders on historical data you supply. Our advice: review and test any backtesting code the assistant writes before you rely on it.
Information
updated Nov 2, 2026
- Repository
- wshobson/agents
- Folder
plugins/quantitative-trading/skills/backtesting-frameworks
Sources
Docs, issue trackers and discussions this page is built from.
Show all 4Hide
- backtesting-frameworks SKILL.md · github.com
- backtesting-frameworks details.md · github.com
- skills.sh listing · skills.sh
- wshobson/agents · github.com