{"slug":"backtesting-frameworks","title":"backtesting-frameworks","summary":"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.","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-01T18:59:42.532335Z","repo":{"url":"https://github.com/wshobson/agents","stars":39771,"forks":4241,"license":"MIT","updatedAt":"2026-09-14T01:07:51Z"},"bodyHtml":"<hr>\n<h2>name: backtesting-frameworks\ndescription: 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.</h2>\n<h1>Backtesting Frameworks</h1>\n<p>Build robust, production-grade backtesting systems that avoid common pitfalls and produce reliable strategy performance estimates.</p>\n<h2>When to Use This Skill</h2>\n<ul>\n<li>Developing trading strategy backtests</li>\n<li>Building backtesting infrastructure</li>\n<li>Validating strategy performance</li>\n<li>Avoiding common backtesting biases</li>\n<li>Implementing walk-forward analysis</li>\n<li>Comparing strategy alternatives</li>\n</ul>\n<h2>Core Concepts</h2>\n<h3>1. Backtesting Biases</h3>\n<table>\n<thead>\n<tr>\n<th>Bias</th>\n<th>Description</th>\n<th>Mitigation</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>Look-ahead</strong></td>\n<td>Using future information</td>\n<td>Point-in-time data</td>\n</tr>\n<tr>\n<td><strong>Survivorship</strong></td>\n<td>Only testing on survivors</td>\n<td>Use delisted securities</td>\n</tr>\n<tr>\n<td><strong>Overfitting</strong></td>\n<td>Curve-fitting to history</td>\n<td>Out-of-sample testing</td>\n</tr>\n<tr>\n<td><strong>Selection</strong></td>\n<td>Cherry-picking strategies</td>\n<td>Pre-registration</td>\n</tr>\n<tr>\n<td><strong>Transaction</strong></td>\n<td>Ignoring trading costs</td>\n<td>Realistic cost models</td>\n</tr>\n</tbody>\n</table>\n<h3>2. Proper Backtest Structure</h3>\n<pre><code>Historical Data\n      │\n      ▼\n┌─────────────────────────────────────────┐\n│              Training Set               │\n│  (Strategy Development &amp; Optimization)  │\n└─────────────────────────────────────────┘\n      │\n      ▼\n┌─────────────────────────────────────────┐\n│             Validation Set              │\n│  (Parameter Selection, No Peeking)      │\n└─────────────────────────────────────────┘\n      │\n      ▼\n┌─────────────────────────────────────────┐\n│               Test Set                  │\n│  (Final Performance Evaluation)         │\n└─────────────────────────────────────────┘\n</code></pre>\n<h3>3. Walk-Forward Analysis</h3>\n<pre><code>Window 1: [Train──────][Test]\nWindow 2:     [Train──────][Test]\nWindow 3:         [Train──────][Test]\nWindow 4:             [Train──────][Test]\n                                     ─────▶ Time\n</code></pre>\n<h2>Detailed worked examples and patterns</h2>\n<p>Detailed sections (starting with <code>## Implementation Patterns</code>) live in <code>references/details.md</code>. Read that file when the navigation summary above is insufficient.</p>\n<h2>Best Practices</h2>\n<h3>Do's</h3>\n<ul>\n<li><strong>Use point-in-time data</strong> - Avoid look-ahead bias</li>\n<li><strong>Include transaction costs</strong> - Realistic estimates</li>\n<li><strong>Test out-of-sample</strong> - Always reserve data</li>\n<li><strong>Use walk-forward</strong> - Not just train/test</li>\n<li><strong>Monte Carlo analysis</strong> - Understand uncertainty</li>\n</ul>\n<h3>Don'ts</h3>\n<ul>\n<li><strong>Don't overfit</strong> - Limit parameters</li>\n<li><strong>Don't ignore survivorship</strong> - Include delisted</li>\n<li><strong>Don't use adjusted data carelessly</strong> - Understand adjustments</li>\n<li><strong>Don't optimize on full history</strong> - Reserve test set</li>\n<li><strong>Don't ignore capacity</strong> - Market impact matters</li>\n</ul>\n","files":[{"path":"references/details.md","sizeBytes":18185,"isText":true},{"path":"SKILL.md","sizeBytes":3511,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-01T19:02:18.962646Z","sha256":"E09485BFAED50F0B495418249796AE3A4266B41A2EF7D69F1D7AEB80DDAE8AE9","sizeBytes":6284},"review":null,"source":{"repositoryUrl":"https://github.com/wshobson/agents","path":"plugins/quantitative-trading/skills/backtesting-frameworks","license":"MIT","commit":"4236bb91f8395b0435f1d8b8baf9e8e4c69a8620","subtreeSha":"27E95D432CCCA043B145E3FD5DD782F51AA29FD396703C4E56C8D541BD5A5558","lastSyncedAt":"2026-09-18T12:19:56.254821Z"},"reviewedAt":"2026-09-01T19:08:03.487751Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/wshobson/agents/tree/main/plugins/quantitative-trading/skills/backtesting-frameworks"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install wshobson-agents@llmmart"},{"target":"git","command":"git clone https://github.com/wshobson/agents.git"}]}