Xpersona
S

Strategy Backtest

CLAWHUB · Unverified

Quantitative strategy backtesting—implement, run, and tune trading rules on historical data; performance metrics (CAGR, max drawdown, Sharpe, win rate) and s... Skill: Strategy Backtest Owner: mikeclaw007 Summary: Quantitative strategy backtesting—implement, run, and tune trading rules on historical data; performance metrics (CAGR, max drawdown, Sharpe, win rate) and s... Tags: latest:1.0.0 Version history: v1.0.0 | 2026-03-25T08:14:08.338Z | auto - Initial release: backtest and optimize systematic trading strategies using historical data. - Supports metrics like CAGR, max d

62
Rank
84
Safety
1.6k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s173n2mnssqbs3ebpdz3b52ssh83gshx:strategy-backtest
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-mikeclaw007-strategy-backtest/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

9,975 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: strategy-backtest
description: |
  Quantitative strategy backtesting—implement, run, and tune trading rules on historical data; performance metrics (CAGR, max drawdown, Sharpe, win rate) and simple parameter sweeps. Keywords: backtest, algorithmic trading, Backtrader, moving average, MACD, RSI, walk-forward, risk.
---

# Strategy Backtest — Historical Performance & Optimization

## Overview

Supports **systematic trading strategy** workflows: **backtest** rules on history, **optimize** parameters (e.g. grid search), and **report** results. Typical building blocks include **moving-average crosses**, **MACD**, **RSI**, and custom signals—implemented with libraries such as **Backtrader** or similar.

**Trigger keywords:** backtest, trading strategy, quant, algorithmic trading, Sharpe, drawdown, optimize parameters, walk-forward

## Prerequisites

```bash
pip install pandas numpy backtrader matplotlib
```

## Capabilities

1. **Backtest engine** — run strategies on historical OHLCV (or vendor-specific) data.  
2. **Performance analytics** — annualized return, max drawdown, Sharpe-like ratios, win rate (definitions must match your implementation).  
3. **Parameter search** — grid or bounded search over strategy parameters with **out-of-sample** caution (see `references/strategy_backtest_guide.md`).

## Commands

| Command | Description | Example |
|---------|-------------|---------|
| `backtest` | Run a backtest | `python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py backtest [args]` |
| `optimize` | Parameter optimization | `python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py optimize [args]` |
| `report` | Emit a backtest report | `python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py report [args]` |

## Usage (from repository root)

```bash
python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py backtest --strategy ma_cross --symbol SPY --period 3y
python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py optimize --strategy ma_cross --fast 5-20 --slow 20-60
python3 scripts/skills/strategy-backtest/scripts/strategy_backtest_tool.py report --format markdown
```

Use **symbols and venues** appropriate to your data feed (e.g. `SPY`, `QQQ`, or local indices)—the examples above are illustrative.

## Output format (for the agent’s report)

```markdown
# Strategy backtest report

**Generated**: YYYY-MM-DD HH:MM

## Key findings
1. [Finding 1]
2. [Finding 2]
3. [Finding 3]

## Metrics snapshot
| Metric | Value | Notes |
|--------|-------|-------|
| CAGR | X% | … |
| Max drawdown | Y% | … |
| Sharpe (if defined) | Z | window & rf assumption |

## Analysis
[Grounded in actual run outputs—no fabricated fills or equity curves.]

## Risks & limitations
- Past performance ≠ future results; costs, slippage, and survivorship bias matter.
```

## References

### Core
- [Backtrader documentation](https://www.backtrader.com/docu/)
- [Backtrader on GitHub](

_meta.json

{
  "ownerId": "kn736js06krgvrxx1g1jkqw0h9831z63",
  "slug": "strategy-backtest",
  "version": "1.0.0",
  "publishedAt": 1774426448338
}

references/strategy_backtest_guide.md

# Strategy Backtest — Framework & Guide

## Tool summary

- **Name**: Strategy Backtest  
- **Commands**: `backtest`, `optimize`, `report`  
- **Typical deps**: `pip install pandas numpy backtrader matplotlib`

## Analysis dimensions

- **Signal design** — rules, indicators, position sizing, risk limits  
- **Data quality** — splits, adjustments, missing bars, survivorship  
- **Performance** — return, drawdown, risk-adjusted metrics, turnover  
- **Robustness** — train/test split, walk-forward, parameter stability  

## Framework

### Phase 1 — Specification
- Universe, frequency, costs, and constraints (long-only, margin, etc.)  
- Reproducible random seeds if any stochastic element exists  

### Phase 2 — Execution & metrics
- Run backtests; log equity curve and trades  
- Align metric definitions (annualization, risk-free for Sharpe)  

### Phase 3 — Optimization (careful)
- Grid or search over parameters **on in-sample** only; validate **out-of-sample**  
- Watch for **overfitting** when many parameters are tried  

## Scoring rubric (strategy quality — qualitative)

| Score | Level | Meaning | Suggested action |
|-------|-------|---------|-------------------|
| 5 | Strong | Stable OOS, sensible economics | Document and paper-trade |
| 4 | Good | Decent metrics; minor sensitivity | More stress tests |
| 3 | OK | Marginal; parameter-sensitive | Redesign features |
| 2 | Weak | Likely curve-fit | Simplify or abort |
| 1 | Poor | Implausible or unstable | Stop |

## Output template

```markdown
# Backtest analysis

## Hypothesis
- …

## Results (from run)
| Metric | Value |
|--------|-------|

## Overfitting / robustness notes
- …

## Next steps
- …
```

## Reference links

- [Backtrader documentation](https://www.backtrader.com/docu/)  
- [Backtrader on GitHub](https://github.com/mementum/backtrader)  
- [Hacker News — pitfalls](https://news.ycombinator.com/item?id=39462946)  
- [Reddit r/algotrading](https://www.reddit.com/r/algotrading/comments/1073140yyz/quant_backtest_ai/)  

## Tips

1. Always report **assumptions** for fees and slippage.  
2. Prefer **simple** strategies with fewer knobs before large parameter grids.  
3. Treat **live trading** as a different system (latency, fills, regime change).

skill-card.md

## Description:

Guides agents through quantitative trading strategy backtesting, parameter tuning, and reporting workflows using historical data and explicit assumptions.

This skill is ready for commercial/non-commercial use.

## Publisher:

[mikeclaw007](https://clawhub.ai/user/mikeclaw007)

### License/Terms of Use:

MIT-0

## Use Case:

Developers, analysts, and external users can use this skill to structure backtest specifications, run or review strategy workflow commands, compare parameters, and produce concise Markdown reports with assumptions and caveats. Users should verify all metrics from actual execution output before relying on any result.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: The bundled tool returns success messages and stores command arguments without computing full backtest results or reports.

Mitigation: Treat generated records as workflow logs, verify any metrics with a real backtesting engine, and do not present logged success messages as investment analysis.

Risk: Command inputs may contain private dataset paths, account identifiers, proprietary strategy details, or other sensitive information.

Mitigation: Avoid passing secrets or confidential strategy data, and test the skill only in an isolated environment.

Risk: Trading strategy backtests can be misleading when costs, slippage, survivorship bias, or overfitting are not handled explicitly.

Mitigation: Document assumptions, validate out of sample, and include limitations in any report.

## Reference(s):

- [Strategy Backtest Guide](references/strategy_backtest_guide.md)
- [Backtrader Documentation](https://www.backtrader.com/docu/)
- [Backtrader on GitHub](https://github.com/mementum/backtrader)
- [Hacker News Backtesting Pitfalls Discussion](https://news.ycombinator.com/item?id=39462946)
- [Reddit r/algotrading Discussion](https://www.reddit.com/r/algotrading/comments/1073140yyz/quant_backtest_ai/)

## Skill Output:

**Output Type(s):** [text, markdown, code, shell commands, guidance]

**Output Format:** [Markdown reports, JSON command output, and shell command examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Backtest metrics must be grounded in actual run output; command inputs may be stored locally by the bundled tool.]

## Skill Version(s):

1.0.0 (source: server release metadata)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

data/strategy_backtest_data.json

{
  "records": [
    {
      "timestamp": "2026-03-25T16:10:16.456636",
      "command": "backtest",
      "input": "",
      "status": "completed"
    }
  ],
  "created": "2026-03-25T16:10:16.456623",
  "tool": "strategy-backtest"
}

Sponsored

Ads related to Strategy Backtest and adjacent AI workflows.