- 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 tools 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.
What you get
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.
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 7 days ago
- Passed all security checks, Safe to install