strategy-compare
Compare multiple strategies or directions (long vs short vs both) on the same symbol. Generates side-by-side stats table.
Security Assessment
About strategy-compare
This skill generates a Python script that compares multiple trading strategies — or trade directions such as long versus short versus both — on the same symbol, producing a side-by-side statistics table. It solves the problem of quickly benchmarking several strategies against each other and against a market benchmark within a VectorBT backtesting workflow, using OpenAlgo for data and technical indicators.
Given a symbol and a list of strategy names as arguments, the skill builds a comparison script under a backtesting/strategy_comparison directory. The script fetches data once via OpenAlgo (or loads directly from a read-only DuckDB path if supplied), computes indicators using OpenAlgo's ta module by default (only switching to TA-Lib on explicit request, and always using OpenAlgo ta for specialty indicators like Supertrend and Donchian), cleans signals with exrem, and runs each strategy on the same data. It applies Indian delivery-equity fee assumptions, includes a NIFTY benchmark via OpenAlgo's index, and prints a comparison table of total return, Sharpe, Sortino, max drawdown, win rate, trades, and profit factor. It then explains in plain language which strategy performed best and why, plots overlaid equity curves with Plotly in a dark template, and saves the comparison to CSV.
It targets quantitative traders and developers using VectorBT and OpenAlgo, particularly in the Indian equity market. It is a thin script-generation helper that relies on the companion vectorbt-expert skill for detailed reference rules.
FAQ
What does this skill produce?
A Python comparison script (named per symbol) that runs several strategies on the same data and prints a side-by-side stats table plus overlaid equity curves and a CSV export.
What libraries and data sources does it use?
VectorBT for backtesting, OpenAlgo for data and technical indicators (with optional DuckDB data loading), and Plotly for charting.
Which strategies are compared by default?
If only a symbol is given, it compares ema-crossover, rsi, donchian, and supertrend; if 'long-vs-short' is passed, it compares longonly, shortonly, and both for the first real strategy.
What metrics does the comparison table include?
Total return, Sharpe, Sortino, max drawdown, win rate, number of trades, and profit factor, alongside a NIFTY benchmark.
Does it depend on other skills?
Yes. It instructs reading the companion vectorbt-expert skill rules for reference patterns such as DuckDB data loading and indicator usage.
Install strategy-compare
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
marketcalls/vectorbt-backtesting-skills