# backtest

backtest runs historical simulations for crypto trading ideas to report actual returns, drawdowns, and performance metrics.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 217 installs · ★ 33 repo stars
- Author: Starchild-ai-agent
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/Starchild-ai-agent/official-skills/tree/HEAD/backtest/SKILL.md
- Updated: 2026-10-22
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/starchild-ai-agent-backtest

## What it does

The skill converts entry and exit rules into runnable Python scripts. Before generating code, the assistant clarifies target assets, time horizons, and triggers. Code runs through existing tools in `scripts/` or generates new ones, producing performance charts and summaries in `output/`.

It handles two core execution modes: fast vectorized passes for basic signal tests and bar-by-bar loops for orders with stop-loss or dynamic position sizing. Logic automatically shifts indicators by one step to counter look-ahead bias and factors in a baseline 0.1% trade fee.

Without a valid `COINGECKO_API_KEY` and the `pandas`, `numpy`, and `mplfinance` Python packages, data retrieval and execution will fail.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add Starchild-ai-agent/official-skills --skill backtest -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/backtest/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/backtest/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add Starchild-ai-agent/official-skills --skill backtest -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/backtest/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add Starchild-ai-agent/official-skills --skill backtest -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/backtest/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install Starchild-ai-agent/official-skills backtest
```

2. **Manually: put the files in place**
- File: `.github/skills/backtest/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add Starchild-ai-agent/official-skills --skill backtest -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/Starchild-ai-agent/official-skills --path backtest
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/backtest/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add Starchild-ai-agent/official-skills --skill backtest -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/Starchild-ai-agent/official-skills/tree/HEAD/backtest/SKILL.md

## When to use it
- Test moving average or RSI indicators against historical crypto prices
- Calculate portfolio drawdown, total return, and Sharpe ratios
- Simulate order execution with trading fees and realistic bar delays
- Generate equity curve charts and summary visuals

## Example prompts
- Backtest an EMA crossover strategy on BTC using historical hourly data
- Run an RSI mean-reversion test on ETH and calculate max drawdown with fees
- Evaluate a walk-forward MACD setup and save equity charts to output

## Similar
- [quant-analyst](https://affpapa.org/en/nevibecode/skills/rmyndharis-quant-analyst.md) — skill · 123 installs
- [backtest-lab](https://affpapa.org/en/nevibecode/skills/backtest-lab.md) — skill · ★ 69 repo stars
- [backtest-expert](https://affpapa.org/en/nevibecode/skills/backtest-expert.md) — skill · 4700 installs
- [correlation-analysis](https://affpapa.org/en/nevibecode/skills/correlation-analysis.md) — skill · 530 installs
- [vectorbt](https://affpapa.org/en/nevibecode/skills/vectorbt.md) — skill · 566 installs
- [backtesting-trading-strategies](https://affpapa.org/en/nevibecode/skills/backtesting-trading-strategies.md) — skill · 4800 installs

## Other versions with the same name
- [backtest · marketcalls](https://affpapa.org/en/nevibecode/skills/backtest.md) — 3500 installs

From the same set: [starchild-ai-agent/official-skills](https://affpapa.org/en/nevibecode/by/starchild-ai-agent/official-skills.md) — 66 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
