strategy-compare — Claude Code skill: side-by-side strategy stats
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.
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a claude-codeWhat strategy-compare 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.
What it helps with
- 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 for the agent
- /strategy-compare RELIANCE ema-crossover rsi donchian
- /strategy-compare SBIN long-vs-short ema-crossover
- /strategy-compare NIFTY
How to install strategy-compare
1Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a claude-code2Manually: put the files in place
~/.claude/skills/strategy-compare/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/strategy-compare/
1Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a codex2Manually: put the files in place
.agents/skills/strategy-compare/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a cursor2Manually: put the files in place
.cursor/skills/strategy-compare/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install marketcalls/vectorbt-backtesting-skills strategy-compare2Manually: put the files in place
.github/skills/strategy-compare/SKILL.md1Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a gemini-cli2Platform CLI
gemini skills install https://github.com/marketcalls/vectorbt-backtesting-skills --path .claude/skills/strategy-compareManually: put the files in place
.devin/skills/strategy-compare/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about strategy-compare
How do I install strategy-compare in Claude?
Run npx skills add marketcalls/vectorbt-backtesting-skills --skill strategy-compare -a claude-code. The skill file then sits at ~/.claude/skills/strategy-compare/SKILL.md.
What does strategy-compare do?
It runs multiple strategies or directions on the same symbol and lines their metrics up side by side. The table covers total return, Sharpe, Sortino, max drawdown, win rate, trade count and profit factor.
Which strategies are compared when none are given?
With only a symbol, the skill uses ema-crossover, rsi, donchian and supertrend. If long-vs-short appears among the arguments, it compares longonly, shortonly and both for the first real strategy.