--- id: vectorbt version: "1.1.0" license: unclear license_treatment: unclear maintenance: active --- # vectorbt — Python library for backtesting and analyzing trading strategies at scale License: unclear · Maintenance: active · Downloads: 554.3K/mo ## What it is and what it does VectorBT is a backtesting library that replaces traditional loop-based simulation with matrix operations: instead of running one strategy at a time through historical bars, it packs thousands of configurations into NumPy arrays and accelerates them with Numba (and optionally Rust), executing all variants in parallel. This approach trades sequential clarity for speed, turning parameter sweeps that would take hours into seconds. The library is built on pandas, NumPy, and Numba, with 17 runtime dependencies including scipy, matplotlib, plotly, and scikit-learn. It provides portfolio analytics (trades, drawdowns, Sharpe ratio, Calmar ratio), signal generation and ranking, indicator ecosystems, walk-forward optimization, and interactive Plotly-based visualization. It's designed for both human researchers exploring trading ideas and AI agents automating strategy discovery. Use it for: - Test thousands of moving-average crossover parameter combinations across multiple assets and timeframes in minutes. - Analyze portfolio performance metrics (win rate, profit factor, expectancy, Sharpe ratio) for individual strategy configurations. - Generate and backtest random or synthetic trading signals to estimate strategy robustness and edge. - Build walk-forward optimization pipelines for label generation and machine-learning-based strategy development. - Visualize strategy results interactively with Plotly heatmaps, scatter plots, and animated indicator overlays. - Download and preprocess market data from Yahoo Finance, then run portfolio simulations with fees and position sizing. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Vectorized backtesting engine that packs thousands of trading strategy configurations into NumPy arrays and runs them in parallel using Numba acceleration, turning grid searches into seconds instead of hours. Yes, with conditions. Install if you need fast, large-scale strategy backtesting and can work with Python 3.11+. The low install friction, active maintenance, and strong community adoption make it reliable. However, verify the fair-code Apache 2.0 + Commons Clause license terms before using in commercial or proprietary products—the license treatment is flagged as unclear in the metadata. ## Install pip install vectorbt uv add vectorbt poetry add vectorbt ## Installing vectorbt Before you install: Low friction: pure Python wheel with no compiled dependencies required for the base install. Active maintenance with a recent release (40 days old) and strong community signal (8675 stars). Requires Python 3.11–3.14. License in practice: License treatment is unclear in the metadata. The description mentions Apache 2.0 with Commons Clause (fair-code), which permits free use but restricts commercial redistribution—verify the actual license terms before use in proprietary or commercial contexts. Quickstart: import vectorbt as vbt data = vbt.YFData.download("BTC-USD") price = data.get("Close") pf = vbt.Portfolio.from_holding(price, init_cash=100) print(pf.total_profit()) Requires Python 3.11 or later. Optional Rust engine available via pip install vectorbt[rust] for precompiled speed. Verify before relying: - Actual license terms and commercial use restrictions under the fair-code Apache 2.0 + Commons Clause model - Performance characteristics and memory footprint when testing thousands of strategy configurations - Compatibility and integration depth with TA-Lib and Pandas TA mentioned in the description ## Package facts - License: not declared (unclear) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 554.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags vectorized backtesting, trading strategy grid search, large-scale portfolio analysis, fast strategy optimization, multi-asset backtesting, numpy-based trading research, parallel strategy testing, backtesting, trading-research, vectorized-computation [View on SkillFed](https://skillfed.io/packages/vectorbt) · [View on PyPI](https://pypi.org/project/vectorbt/)