polakowo/vectorbt
The backtesting engine that gives you an unfair advantage. Run thousands of trading ideas before others finish one.
What it solves
VectorBT addresses the inefficiency of traditional backtesting, which typically loops through data bars one strategy at a time. This slow process makes large-scale parameter optimization and grid searches time-consuming and impractical for researchers.
How it works
Instead of iterative loops, VectorBT uses a vectorized approach. It packs thousands of strategy configurations into NumPy arrays and processes them simultaneously. To maximize performance, it leverages Numba for just-in-time compilation and offers an optional Rust engine to eliminate JIT overhead, allowing it to turn hours of grid search into seconds.
Who it’s for
It is designed for financial researchers, quantitative traders, and AI agents who need to perform high-speed experimentation and large-scale backtesting across multiple assets and timeframes.
Highlights
- Vectorized Backtesting: Uses pandas, NumPy, and Numba for high-performance strategy research.
- Large-Scale Parameter Sweeps: Supports flexible broadcasting to test thousands of window combinations or random strategies at once.
- Comprehensive Analytics: Provides detailed portfolio performance metrics, including drawdowns, win rates, and Sharpe/Sortino ratios.
- Interactive Visualization: Integrates with Plotly and Jupyter widgets for heatmaps, scatterplots, and animated financial charts.
- ML-Ready: Includes robustness testing, walk-forward optimization, and label generation for machine learning workflows.
Related
- Project
- Project
- Project
- Project
- Project