Tutorials
From Python to Rust
Take one strategy from vectorized Python to live, stateful Rust
Backtesting code often grows up with its strategy. It starts as a few lines in a notebook, and it can end up as a service with no Python in it at all. This three-part tutorial takes one volatility-squeeze breakout along that path. The data and the rules never change, so the only difference between the versions is how they are written.
✅ Learn how to write the same strategy four times, from short research code down to a standalone program that runs without Python. All four are then checked against each other, order for order.
✅ Some rules cannot be prepared in advance, because they depend on what the strategy just did. Learn where a rule like that belongs, and see it produce the one result in this tutorial that could not have been worked out before the simulation ran.
✅ Finally, learn how to carry one portfolio forward as new bars arrive, instead of rerunning the whole backtest each time, and how a Rust process picks up where it left off after a restart 🔄
Topics
Static simulation
Learn how to backtest the same strategy with high-level VBT, Numba, PyO3 Rust, and native Rust
Dynamic simulation
Learn how to implement stateful portfolio callbacks and stream the same strategy in native Rust
Live simulation
Learn how to continue a path-dependent simulation as new bars arrive and preserve it across restarts
Copyright © 2021–2026 Oleg Polakow. All rights reserved.
Site content and documentation are provided for using and evaluating VectorBT PRO and for educational purposes. Any other use, including building or supporting competing products or services, requires prior written consent.