backtest-expert
Skill0 starsChanged 3 months agoMITView on GitHub
Expert guidance for systematic backtesting of trading strategies. Use when developing, testing, stress-testing, or validating quantitative trading strategies. Covers "beating ideas to death" methodology, parameter robustness testing, slippage modeling, bias prevention, and interpreting backtest results. Applicable when user asks about backtesting, strategy validation, robustness testing, avoiding overfitting, or systematic trading development.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- ntaffzii/Skill-Agentstheir own version, first seen Nov 25, 2026
- IngAs8/ClaudeSkillword for word, first seen Sep 28, 2026
- Wind-Alice/AliceMarketword for word, first seen Apr 28, 2026
- ajeeshworkspace/indian-trading-skillstheir own version, first seen Mar 12, 2026
Other versions4 projects use a version of this.
Word for word · 2
- Wind-Alice/AliceMarket★ 147100% same
- IngAs8/ClaudeSkill★ 0100% same
Edited · 0
None found.
Wrote their own version · 2
- ajeeshworkspace/indian-trading-skills★ 75same name
- ntaffzii/Skill-Agents★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository71 other files it gives its agents.
- breadth-chart-analystSkill
- breakout-trade-plannerSkill
- canslim-screenerSkill
- contrarian-setup-gateSkill
- cot-contrarian-detectorSkill
- crypto-regime-analyzerSkill
- data-quality-checkerSkill
- dividend-growth-pullback-screenerSkill
- downtrend-duration-analyzerSkill
- drawdown-circuit-breakerSkill
- dual-axis-skill-reviewerSkill
- earnings-calendarSkill
- earnings-trade-analyzerSkill
- economic-calendar-fetcherSkill
- edge-candidate-agentSkill
- edge-concept-synthesizerSkill
- edge-hint-extractorSkill
- edge-pipeline-orchestratorSkill
- edge-signal-aggregatorSkill
- edge-strategy-designerSkill
- edge-strategy-reviewerSkill
- exposure-coachSkill
- finviz-screenerSkill
- ftd-detectorSkill
- futures-position-sizerSkill
- fxmacrodata-calendarSkill
- ibd-distribution-day-monitorSkill
- institutional-flow-trackerSkill
- kanchi-dividend-review-monitorSkill
- kanchi-dividend-sopSkill
- kanchi-dividend-us-tax-accountingSkill
- macro-regime-detectorSkill
- market-breadth-analyzerSkill
- market-environment-analysisSkill
- market-news-analystSkill
- market-top-detectorSkill
- mt5-robot-testerSkill
- news-reaction-failure-analyzerSkill
- options-strategy-advisorSkill
- pair-trade-screenerSkill
- parabolic-short-trade-plannerSkill
- pead-screenerSkill
- portfolio-managerSkill
- position-sizerSkill
- pre-trade-discipline-gateSkill
- residual-edge-analyzerSkill
- scenario-analyzerSkill
- sector-analystSkill
- signal-postmortemSkill
- skill-designerSkill
- skill-idea-minerSkill
- skill-integration-testerSkill
- stanley-druckenmiller-investmentSkill
- stockbee-20pct-studySkill
- stockbee-episodic-pivot-analyzerSkill
- stockbee-exhaustion-hammer-screenerSkill
- stockbee-momentum-burst-screenerSkill
- stockbee-setup-fluency-trainerSkill
- strategy-pivot-designerSkill
- technical-analystSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
26 rules. About 0 are common, 26 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈26
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Principle: Add friction, stress test assumptions, and see what survives.
- Distinctive: line 18
Use this skill when:
- Distinctive: line 30
No API keys required
- Distinctive: line 31
No external data dependencies — metrics are user-provided
- Distinctive: line 41
If you can't articulate the edge clearly, don't proceed to testing.
- Distinctive: line 47
Exit: Stop loss, profit target, time-based exit
- Distinctive: line 52
Critical: No subjective judgment allowed.
- Distinctive: line 68
Test stop loss at 50%, 75%, 100%, 125%, 150% of baseline
- Distinctive: line 69
Test profit target at 80%, 90%, 100%, 110%, 120% of baseline
- Distinctive: line 71
Look for "plateaus" of stable performance, not narrow spikes
- Distinctive: line 76
Add realistic order rejection scenarios
- Distinctive: line 77
Test with pessimistic commission structures
- Distinctive: line 82
Ensure strategy doesn't rely on 1-2 exceptional periods
- Distinctive: line 83
Test in different market regimes separately
- Distinctive: line 94
Test on validation period (Year 4)
- Distinctive: line 117
Use the evaluation script for a structured, quantitative assessment:
- Distinctive: line 149
Look for parameter ranges where performance is stable, not optimal values that create performance spikes.
- Distinctive: line 159
Right approach: Test every stock that met criteria, including those that failed
- Distinctive: line 166
Validation: Must be purely data-driven
- Distinctive: line 168
Never let attachment to an idea influence interpretation of test results.
- Distinctive: line 174
Parameter sensitivity: Only works with exact parameter values
- Distinctive: line 206
When to read: When strategy fails tests, or learning from past mistakes.
- Distinctive: line 218
Context-free requirement: If strategy requires "perfect context" to work, it's not robust enough for systematic trading.
- Distinctive: line 220
Red flag: If backtest results look too good (>90% win rate, minimal drawdowns, perfect timing), audit carefully for look-ahead bias or data …
- Distinctive: line 229
All rules are codified in advance
- Distinctive: line 230
No discretion or "feel" in execution
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Backtest Expert
Systematic approach to backtesting trading strategies based on professional methodology that prioritizes robustness over optimistic results.
Core Philosophy
Goal: Find strategies that "break the least", not strategies that "profit the most" on paper.
Principle: Add friction, stress test assumptions, and see what survives. If a strategy holds up under pessimistic conditions, it's more likely to work in live trading.
When to Use This Skill
Use this skill when:
- Developing or validating systematic trading strategies
- Evaluating whether a trading idea is robust enough for live implementation
- Troubleshooting why a backtest might be misleading
- Learning proper backtesting methodology
- Avoiding common pitfalls (curve-fitting, look-ahead bias, survivorship bias)
- Assessing parameter sensitivity and regime dependence
- Setting realistic expectations for slippage and execution costs
Prerequisites
- Python 3.9+ (for evaluation script)
- No API keys required
- No external data dependencies — metrics are user-provided
Workflow
1. State the Hypothesis
Define the edge in one sentence.
Example: "Stocks that gap up >3% on earnings and pull back to previous day's close within first hour provide mean-reversion opportunity."
If you can't articulate the edge clearly, don't proceed to testing.
2. Codify Rules with Zero Discretion
Define with complete specificity:
- Entry: Exact conditions, timing, price type
- Exit: Stop loss, profit target, time-based exit
- Position sizing: Fixed $$, % of portfolio, volatility-adjusted
- Filters: Market cap, volume, sector, volatility conditions
- Universe: What instruments are eligible
Critical: No subjective judgment allowed. Every decision must be rule-based and unambiguous.
3. Run Initial Backtest
Test over:
- Minimum 5 years (preferably 10+)
- Multiple market regimes (bull, bear, high/low volatility)
- Realistic costs: Commissions + conservative slippage
Examine initial results for basic viability. If fundamentally broken, iterate on hypothesis.
4. Stress Test the Strategy
This is where 80% of testing time should be spent.
Parameter sensitivity:
- Test stop loss at 50%, 75%, 100%, 125%, 150% of baseline
- Test profit target at 80%, 90%, 100%, 110%, 120% of baseline
- Vary entry/exit timing by ±15-30 minutes
- Look for "plateaus" of stable performance, not narrow spikes
Execution friction:
- Increase slippage to 1.5-2x typical estimates
- Model worst-case fills (buy at ask+1 tick, sell at bid-1 tick)
- Add realistic order rejection scenarios
- Test with pessimistic commission structures
Time robustness:
- Analyze year-by-year performance
- Require positive expectancy in majority of years
- Ensure strategy doesn't rely on 1-2 exceptional periods
- Test in different market regimes separately
Sample size:
- Absolute minimum: 30 trades
- Preferred: 100+ trades
- High confidence: 200+ trades
5. Out-of-Sample Validation
Walk-forward analysis:
- Optimize on training period (e.g., Year 1-3)
- Test on validation period (Year 4)
- Roll forward and repeat
- Compare in-sample vs out-of-sample performance
Warning signs:
- Out-of-sample <50% of in-sample performance
- Need frequent parameter re-optimization
- Parameters change dramatically between periods
6. Evaluate Results
Questions to answer:
- Does edge survive pessimistic assumptions?
- Is performance stable across parameter variations?
- Does strategy work in multiple market regimes?
- Is sample size sufficient for statistical confidence?
- Are results realistic, not "too good to be true"?
Decision criteria:
- ✅ Deploy: Survives all stress tests with acceptable performance
- 🔄 Refine: Core logic sound but needs parameter adjustment
- ❌ Abandon: Fails stress tests or relies on fragile assumptions
Use the evaluation script for a structured, quantitative assessment:
python3 skills/backtest-expert/scripts/evaluate_backtest.py \
--total-trades 150 \
--win-rate 62 \
--avg-win-pct 1.8 \
--avg-loss-pct 1.2 \
--max-drawdown-pct 15 \
--years-tested 8 \
--num-parameters 3 \
--slippage-tested \
--output-dir reports/The script scores across 5 dimensions (Sample Size, Expectancy, Risk Management, Robustness, Execution Realism), detects red flags, and outputs a Deploy/Refine/Abandon verdict.
Key Testing Principles
Punish the Strategy
Add friction everywhere:
- Commissions higher than reality
- Slippage 1.5-2x typical
- Worst-case fills
- Order rejections
- Partial fills
Rationale: Strategies that survive pessimistic assumptions often outperform in live trading.
Seek Plateaus, Not Peaks
Look for parameter ranges where performance is stable, not optimal values that create performance spikes.
Good: Strategy profitable with stop loss anywhere from 1.5% to 3.0% Bad: Strategy only works with stop loss at exactly 2.13%
Stable performance indicates genuine edge; narrow optima suggest curve-fitting.
Test All Cases, Not Cherry-Picked Examples
Wrong approach: Study hand-picked "market leaders" that worked Right approach: Test every stock that met criteria, including those that failed
Selective examples create survivorship bias and overestimate strategy quality.
Separate Idea Generation from Validation
Intuition: Useful for generating hypotheses Validation: Must be purely data-driven
Never let attachment to an idea influence interpretation of test results.
Common Failure Patterns
Recognize these patterns early to save time:
- Parameter sensitivity: Only works with exact parameter values
- Regime-specific: Great in some years, terrible in others
- Slippage sensitivity: Unprofitable when realistic costs added
- Small sample: Too few trades for statistical confidence
- Look-ahead bias: "Too good to be true" results
- Over-optimization: Many parameters, poor out-of-sample results
See references/failed_tests.md for detailed examples and diagnostic framework.
Output
reports/backtest_eval_<timestamp>.json— structured evaluation with per-dimension scores, red flags, and verdictreports/backtest_eval_<timestamp>.md— human-readable report with dimension table, key metrics, and red flag details
Resources
Methodology Reference
File: references/methodology.md
When to read: For detailed guidance on specific testing techniques.
Contents:
- Stress testing methods
- Parameter sensitivity analysis
- Slippage and friction modeling
- Sample size requirements
- Market regime classification
- Common biases and pitfalls (survivorship, look-ahead, curve-fitting, etc.)
Failed Tests Reference
File: references/failed_tests.md
When to read: When strategy fails tests, or learning from past mistakes.
Contents:
- Why failures are valuable
- Common failure patterns with examples
- Case study documentation framework
- Red flags checklist for evaluating backtests
Critical Reminders
Time allocation: Spend 20% generating ideas, 80% trying to break them.
Context-free requirement: If strategy requires "perfect context" to work, it's not robust enough for systematic trading.
Red flag: If backtest results look too good (>90% win rate, minimal drawdowns, perfect timing), audit carefully for look-ahead bias or data issues.
Tool limitations: Understand your backtesting platform's quirks (interpolation methods, handling of low liquidity, data alignment issues).
Statistical significance: Small edges require large sample sizes to prove. 5% edge per trade needs 100+ trades to distinguish from luck.
Discretionary vs Systematic Differences
This skill focuses on systematic/quantitative backtesting where:
- All rules are codified in advance
- No discretion or "feel" in execution
- Testing happens on all historical examples, not cherry-picked cases
- Context (news, macro) is deliberately stripped out
Discretionary traders study differently—this skill may not apply to setups requiring subjective judgment.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

