Vectorized backtesting
Vectorized (vector-based) backtesting evaluates a strategy by computing over whole arrays of history at once — signals, positions and returns as pandas/NumPy columns — instead of stepping through bars one at a time. awesome-systematic-trading treats it as one of the two top-level families of backtest engine, listing vectorbt, pysystemtrade and bt against a much longer roster of event-driven frameworks.
The trade
The appeal is throughput. vectorbt, accelerated by Numba over pandas and NumPy, advertises testing thousands of strategy variants in seconds. That matters because tuning re-runs the backtest hundreds or thousands of times, and backtest speed is what caps how much of the strategy space you can search.
What you give up is fidelity and the guard rails that come with it:
- Lookahead bias gets easier to commit. In a forward-only event stream a strategy cannot see the next bar. In an array formulation the next bar is one index away, and an off-by-one shift is a silent bug that shows up as a beautiful equity curve — the cardinal failure, reintroduced by the programming model.
- Order-level state is hard to express. Partial fills, per-order stops, position-dependent sizing and multi-account bookkeeping are naturally sequential; a whole-array pass approximates them or skips them.
- No backtest/live parity. Live trading is an event stream, so a vectorized research pass has to be re-implemented for production — two codebases, and the gap between them is somewhere a validated strategy can quietly stop being the one that trades.
Where each fits
The practical division is research vs. production: vector-based for wide, cheap sweeps over the strategy space; event-driven for the candidates that survive, where fill realism and one-codebase parity are worth the slowdown. The framework counts in awesome-systematic-trading hint at where the field’s weight sits: roughly nineteen event-driven entries to three vector-based ones. Star-ranked catalog listings measure adoption, not merit.
Related
backtesting · event-driven-trading · strategy-optimization · awesome-systematic-trading · algorithmic-trading · synthesis