vectorbt-expert
Vectorbt backtesting with TA-Lib indicators, OpenAlgo data, and Indian market fee modeling.
- Supports multiple data sources: OpenAlgo (Indian markets), yfinance (US/Global), CCXT (Crypto), and direct DuckDB loading with auto-format detection
- Always uses TA-Lib for standard indicators (EMA, RSI, MACD, ATR, etc.) and OpenAlgo ta for specialty indicators (Supertrend, Donchian, Ichimoku) plus signal cleaning (exrem, crossover, crossunder)
- Includes market-specific fee models for India (STT + statutory + Rs 20/order), US equities/options/futures, and crypto spot/futures with automatic benchmark selection (NIFTY 50, S&P 500, Bitcoin)
- Produces Strategy vs Benchmark comparison tables, performance stats, Plotly candlestick charts with category x-axis, and plain-language trade analysis reports
- Provides 12+ production-ready strategy templates (EMA Crossover, RSI, Donchian, Supertrend, MACD, Momentum, Walk-Forward) with realistic costs and detailed rule documentation for parameter optimization, position sizing, stop-loss/take-profit, and robustness testing
VectorBT Backtesting Expert Skill
Environment
- Python with vectorbt, pandas, numpy, plotly
- Data sources: OpenAlgo (Indian markets), DuckDB (direct database), yfinance (US/Global), CCXT (Crypto), custom providers
- DuckDB support: supports both custom DuckDB and OpenAlgo Historify format
- API keys loaded from single root
.envviapython-dotenv+find_dotenv()— never hardcode keys - Technical indicators: TA-Lib (ALWAYS - never use VectorBT built-in indicators)
- Specialty indicators:
openalgo.tafor Supertrend, Donchian, Ichimoku, HMA, KAMA, ALMA, ZLEMA, VWMA - Signal cleaning:
openalgo.tafor exrem, crossover, crossunder, flip - Fee model: Indian market standard (STT + statutory charges + Rs 20/order)
- Benchmark: NIFTY 50 via OpenAlgo (
NSE_INDEX) by default - Charts: Plotly with
template="plotly_dark" - Environment variables loaded from single
.envat project root viafind_dotenv()(walks up from script dir) - Scripts go in
backtesting/{strategy_name}/directories (created on-demand, not pre-created) - Never use icons/emojis in code or logger output
Critical Rules
More from marketcalls/vectorbt-backtesting-skills
backtest
Quick backtest a strategy on a symbol. Creates a complete .py script with data fetch, signals, backtest, stats, and plots.
1.3Koptimize
Optimize strategy parameters using VectorBT. Tests parameter combinations and generates heatmaps.
918strategy-compare
Compare multiple strategies or directions (long vs short vs both) on the same symbol. Generates side-by-side stats table.
881quick-stats
Quickly fetch data and print key backtest stats for a symbol with a default EMA crossover strategy. No file creation needed - runs inline in a notebook cell or prints to console.
836setup
Set up the Python backtesting environment. Detects OS, creates virtual environment, installs dependencies (openalgo, ta-lib, vectorbt, plotly), and creates the backtesting folder structure.
796