# strategy-compare

Runs several trading strategies or directions on one symbol and puts their metrics in a single table. Useful when you need to pick what to test next.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2300 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/strategy-compare/SKILL.md
- Updated: 2026-07-12
- HTML: https://affpapa.org/en/nevibecode/skills/strategy-compare

## What it does

The skill takes a symbol plus a list of strategies and writes a script to `backtesting/strategy_comparison/` named `{symbol}_strategy_comparison.py`. Data is fetched once through OpenAlgo, every strategy runs on the same series, and the metrics land in one table: total return, Sharpe, Sortino, max drawdown, win rate, trade count and profit factor. A NIFTY benchmark is added via `NSE_INDEX`, and equity curves for all variants are overlaid in Plotly with `template="plotly_dark"`. The comparison is saved to CSV.

Indicators come from OpenAlgo ta by default, not from VectorBT built-ins. Switching to TA-Lib happens only when you ask for it by name. For Supertrend and Donchian there is no choice: TA-Lib has no equivalent, so OpenAlgo ta handles them. Signals are cleaned with `ta.exrem()`, and `.fillna(False)` always runs before that call.

Pass a DuckDB path and the script reads straight from it with `duckdb.connect(path, read_only=True)`. In that standalone mode `openalgo.ta` may not import, so an inline `exrem()` fallback is used instead. Fees are set for Indian equity delivery: `fees=0.00111` and `fixed_fees=20`. With no strategies listed, the skill compares `ema-crossover`, `rsi`, `donchian` and `supertrend`; the token `long-vs-short` switches the run to longonly, shortonly and both for the first real strategy.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install marketcalls/vectorbt-backtesting-skills strategy-compare
```

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

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/marketcalls/vectorbt-backtesting-skills --path .claude/skills/strategy-compare
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -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/strategy-compare/SKILL.md

## When to use it
- compare several strategies on one symbol in a single table
- check how long-only and short-only behave on the same data
- add a NIFTY benchmark to backtest results
- compute metrics with Indian delivery fees applied
- save the comparison to CSV and overlay equity curves

## Example prompts
- /strategy-compare RELIANCE ema-crossover rsi donchian
- /strategy-compare SBIN long-vs-short ema-crossover
- /strategy-compare NIFTY

## Similar
- [strategy-framework](https://affpapa.org/en/nevibecode/skills/strategy-framework.md) — skill · 500 installs
- [vectorbt](https://affpapa.org/en/nevibecode/skills/vectorbt.md) — skill · 492 installs
- [strategy-pivot-designer](https://affpapa.org/en/nevibecode/skills/strategy-pivot-designer.md) — skill · 3300 installs
- [custom-indicator](https://affpapa.org/en/nevibecode/skills/custom-indicator.md) — skill · 563 installs
- [live-feed](https://affpapa.org/en/nevibecode/skills/live-feed.md) — skill · 550 installs
- [stockbee-20pct-study](https://affpapa.org/en/nevibecode/skills/stockbee-20pct-study.md) — skill · 2600 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
