- Home
- Skills
- Trading & Investing
- backtest strategy builder
backtest strategy builder
Convert trading ideas into auditable, bias-controlled backtest specifications and objective rulebooks.
$5
Works with the AI Agents you already use
backtest strategy builder
Example session with this skill installed
I want to backtest a strategy that buys the S&P 500 when the RSI is oversold and sells when it's overbought on the daily chart. Account for costs.
- Read your context and instructions
- Compiled the backtest strategy builder
I have formalized your RSI mean-reversion idea into a deterministic backtest specification, incorporating slippage and institutional bias controls.
Strategy Rulebook
| Phase | Logic | Note |
|---|---|---|
| Market Universe | SPY (S&P 500 ETF) | High liquidity reduces slippage impact. |
| Entry Trigger | Close < 30 on 14-period RSI | Evaluated at daily close for next-bar open. |
| Exit Trigger | Close > 70 on 14-period RSI | Prevents "holding forever" in trending markets. |
| Position Sizing | 100% Equity, no leverage | Baseline for unleveraged performance. |
Data Specification
- Resolution: Daily OHLCV data.
- Source: Adjusted for dividends and stock splits to prevent artificial price gaps.
- Period: Minimum 10 years to capture multiple market cycles (2014-2024).
Bias Checklist
- Look-ahead Bias: Rules use
T-0close to execute atT+1open. - Slippage: Modeled at 1 cent per share + 5 bps for market impact.
- Transaction Costs: $0.005 per share commission baseline.
Metric Set
- Risk-Adjusted: Sharpe Ratio, Sortino Ratio.
- Drawdown: Maximum Drawdown (MDD) and Ulcer Index.
- Efficiency: Profit Factor and Win/Loss Ratio.
Robustness Tests
Sensitivity Analysis: Vary RSI levels (e.g., 25/75 vs 30/70) to ensure the edge isn't a "fluke" of specific numbers.
2. Walk-Forward: Optimize on 2014-2020 data; validate on 2021-2024 data.
Interpretation Guide
If the result shows high performance only in low-volatility regimes, the strategy is likely a "carry" proxy. Pay close attention to the Recovery Factor (Net Profit / Max Drawdown) to gauge emotional tradability.
Next steps
- Export this spec to a Python/Backtrader script or Pine Script.
- Source split-adjusted daily SPY data.
- Run the sensitivity analysis on the RSI periods (10 to 20).
Connects securely to your tools. The creator never sees your data.
About this skill
Trading strategies often fail because they lack the objective rules required for valid historical testing. This skill takes raw trading ideas and converts them into rigorous, implementation-ready backtest specifications. It forces clarity on entry and exit logic while embedding professional controls to prevent common pitfalls like look-ahead bias and overfitting.
What it does
- Rule Formalization converts vague technical or fundamental ideas into deterministic, auditable trading rules.
- Bias Prevention identifies and mitigates look-ahead bias, survivorship bias, and selection bias before you write a line of code.
- Data Specification defines the exact market universe, timeframe, and data quality requirements needed for a valid test.
- Risk Modeling integrates slippage, transaction costs, and liquidity constraints into the strategy design.
- Robustness Testing outlines methods like walk-forward analysis and parameter sensitivity checks to ensure strategy stability.
How it works
- Input Analysis identifies your core strategy concept and separates established facts from underlying assumptions.
- Structural Mapping builds a professional framework following institutional standards for historical research.
- QA Validation runs the design through quality gates to ensure all rules are objective and testable.
- Artifact Generation produces a complete specification including a rulebook, data requirements, and metric sets.
Frameworks & tools
This skill is framework-agnostic, providing logic compatible with Python (Pandas/Backtrader), Pine Script, MetaTrader, or specialized platforms like QuantConnect.
Why this beats prompting it yourself
Generic prompts often overlook subtle biases and produce "wishful thinking" rules that cannot be coded. This skill enforces institutional-grade rigor, ensuring your strategy is actually testable and not just a collection of discretionary observations.
Use cases
- Strategy Auditing before committing capital to a new algorithmic approach.
- Logic Debugging for discretionary traders looking to automate their process.
- Research Design for quantitative analysts building a new hypothesis test.
- Platform Migration by defining logic clearly before porting to a new language.
Known limitations
Does not execute live trades or provide real-time market data. Cannot guarantee future profitability or optimize parameters automatically. Requires the user to provide the basic strategy logic.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Trading & Investing.
Does not execute trades, provide live market data, or perform the actual computation. Requires manual strategy logic input.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 month ago
Permissions
No special permissions declared or detected