polakowo/vectorbt
The backtesting engine that gives you an unfair advantage. Run thousands of trading ideas before others finish one.
What it solves
VectorBT solves the performance bottleneck of traditional backtesting. Instead of looping through price bars one strategy at a time, it allows researchers to test thousands of different strategy configurations, assets, and timeframes simultaneously, reducing the time required for grid searches from hours to seconds.
How it works
The library uses a vectorized approach, packing thousands of configurations into NumPy arrays. It accelerates the "hot path" of execution using Numba and an optional Rust engine to avoid JIT overhead. It integrates deeply with pandas for a native API and uses flexible broadcasting to handle multi-asset analysis and large-scale parameter sweeps.
Who it’s for
It is designed for human quantitative researchers and AI agents who need to perform large-scale experimentation and strategy research in financial markets.
Highlights
- High-performance execution: Leverages NumPy, Numba, and Rust for vectorized backtesting.
- Broadcasting support: Enables testing of thousands of parameter combinations across multiple assets at once.
- Comprehensive analytics: Includes portfolio performance metrics, drawdown analysis, and QuantStats integration.
- ML-ready: Provides robustness testing, walk-forward optimization, and label generation for machine learning workflows.
- Interactive visualization: Built-in support for Plotly, Jupyter widgets, and animated financial charts.
Related
- Project
- Project
- Project
- Project
- Project