backtest — Claude Code skill for strategy tests and setup
Builds a Python script to test a trading strategy against a chosen symbol. It can report performance, compare a benchmark, and plot results.
npx skills add marketcalls/vectorbt-backtesting-skills --skill backtest -a claude-codeWhat backtest 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.
What it helps with
- 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 for the agent
- Run
/backtest ema-crossover RELIANCE NSE Dto 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.
How to install backtest
1Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill backtest -a claude-code2Manually: put the files in place
~/.claude/skills/backtest/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/backtest/
1Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill backtest -a codex2Manually: put the files in place
.agents/skills/backtest/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill backtest -a cursor2Manually: put the files in place
.cursor/skills/backtest/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install marketcalls/vectorbt-backtesting-skills backtest2Manually: put the files in place
.github/skills/backtest/SKILL.md1Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill backtest -a gemini-cli2Platform CLI
gemini skills install https://github.com/marketcalls/vectorbt-backtesting-skills --path .claude/skills/backtestManually: put the files in place
.devin/skills/backtest/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add marketcalls/vectorbt-backtesting-skills --skill backtest -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 backtest
How do I install backtest in Claude Code?
Run npx skills add marketcalls/vectorbt-backtesting-skills --skill backtest -a claude-code. The skill file is placed at ~/.claude/skills/backtest/SKILL.md.
What does the backtest skill do?
It generates a Python script that runs a VectorBT strategy test, gathers performance statistics, plots the results, and saves trades as CSV.
Can it use data stored in DuckDB?
Yes. Pass a database path to load data directly, with support for Historify-style data and a custom ohlcv table. If openalgo.ta cannot be imported, the generated script falls back to inline exrem().