# backtest

Builds a Python script to test a trading strategy against a chosen symbol. It can report performance, compare a benchmark, and plot results.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3400 installs · ★ 211
- Author: marketcalls
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/marketcalls/vectorbt-backtesting-skills/tree/HEAD/.claude/skills/backtest/SKILL.md
- Updated: 2026-07-12
- HTML: https://affpapa.org/en/nevibecode/skills/backtest

## What it does

The skill creates a script under `backtesting/{strategy_name}/` to fetch market data, generate signals, and run a VectorBT backtest. It prints portfolio statistics and a strategy-versus-benchmark comparison, plots equity and drawdown, then exports trades to CSV. Available templates cover EMA Crossover, RSI, Donchian, Supertrend, MACD, SDA2, Momentum, Dual Momentum, Buy & Hold, and RSI Accumulation.

Data can come from OpenAlgo or a DuckDB file supplied by the user. OpenAlgo’s `ta` module handles indicators unless the user specifically requests TA-Lib; the skill also accounts for Indian delivery and futures fees, with lot-based sizing for NIFTY and BANKNIFTY. Check the data source before running the generated script: the backtest needs market data to produce results.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add marketcalls/vectorbt-backtesting-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 marketcalls/vectorbt-backtesting-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 marketcalls/vectorbt-backtesting-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 marketcalls/vectorbt-backtesting-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 marketcalls/vectorbt-backtesting-skills --skill backtest -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/marketcalls/vectorbt-backtesting-skills --path .claude/skills/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 marketcalls/vectorbt-backtesting-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/marketcalls/vectorbt-backtesting-skills/tree/HEAD/.claude/skills/backtest/SKILL.md

## When to use it
- generate a VectorBT script for a chosen strategy and symbol
- load historical prices from OpenAlgo or DuckDB
- compare strategy performance with NIFTY or a requested benchmark
- plot portfolio growth and drawdown
- export executed trades to CSV

## Example prompts
- Run `/backtest ema-crossover RELIANCE NSE D` to create a script that tests this strategy.
- Test RSI on SBIN with `/backtest rsi SBIN`.
- Create a Supertrend backtest for NIFTY on the 5m interval using `/backtest supertrend NIFTY NFO 5m`.

## Similar
- [find-skills](https://affpapa.org/en/nevibecode/skills/find-skills.md) — skill · 4000000 installs
- [frontend-design](https://affpapa.org/en/nevibecode/skills/frontend-design.md) — skill · 1025790 installs
- [grill-me](https://affpapa.org/en/nevibecode/skills/grill-me.md) — skill · 1424476 installs
- [grill-with-docs](https://affpapa.org/en/nevibecode/skills/grill-with-docs.md) — skill · 1219756 installs
- [improve-codebase-architecture](https://affpapa.org/en/nevibecode/skills/improve-codebase-architecture.md) — skill · 1163035 installs
- [design-taste-frontend](https://affpapa.org/en/nevibecode/skills/design-taste-frontend.md) — skill · 678700 installs

From the same set: [marketcalls/vectorbt-backtesting-skills](https://affpapa.org/en/nevibecode/by/marketcalls/vectorbt-backtesting-skills.md) — 6 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
