# backtest

> Claude/Codex skill by [@marketcalls](https://github.com/marketcalls) · 191 stars · Updated 2026-07-12

Quick backtest a strategy on a symbol. Creates a complete .py script with data fetch, signals, backtest, stats, and plots.

Tags: agent-skills, backtesting, monte-carlo, optimization, python, quantstats, robustness, tearsheets, vectorbt, walk-forward

## Install

```sh
git clone https://github.com/marketcalls/vectorbt-backtesting-skills /tmp/vectorbt-backtesting-skills && ln -s /tmp/vectorbt-backtesting-skills/.claude/skills/backtest ~/.claude/skills/backtest
```

## From README

Arguments Parse $ARGUMENTS as: strategy symbol exchange interval $0 = strategy name (e.g., ema-crossover, rsi, donchian, supertrend, macd, sda2, momentum) $1 = symbol (e.g., SBIN, RELIANCE, NIFTY). Default: SBIN $2 = exchange (e.g., NSE, NFO). Default: NSE $3 = interval (e.g., D, 1h, 5m). Default: D If no arguments, ask the user which strategy they want. Instructions Read the vectorbt-expert skill rules for reference patterns Create backtesting/{strategyname}/ directory if it doesn't exist (on-demand) Create a .py file in backtesting/{strategyname}/ named {symbol}{strategy}backtest.py Use the matching template from rules/assets/{strategy}/backtest.py as the starting point The script must: Load .env from the project root using finddotenv() (walks up from script dir automatically) Fetch data via client.history() from OpenAlgo If user provides a DuckDB path, load data directly via duckdb.connect(path, readonly=True) instead of OpenAlgo API.

## Links

- HTML page: https://omgskills.com/library/marketcalls/vectorbt-backtesting-skills/backtest/
- GitHub: https://github.com/marketcalls/vectorbt-backtesting-skills
- Author: [@marketcalls](https://github.com/marketcalls)
