After-work guide to vectorbt backtesting tutorial: NumPy-speed vectorized backtests for research iteration. Educational only. Not investment advice.
You searched for vectorbt backtesting tutorial. After a full day of work, you do not need a 400-page manual—you need a why-first path that fits one evening: understand the angle (NumPy-speed vectorized backtests for research iteration), run a tiny example, and know what not to claim.
This hub article is educational only. Not investment advice. It will not pick stocks, size positions, or promise edge.
Tool focus: vectorbt.
import numpy as np
rng = np.random.default_rng(9)
close = 100 + np.cumsum(rng.normal(0, 1, 200))
w = 10
ma = np.convolve(close, np.ones(w)/w, mode='same')
sig = (close > ma).astype(float)
rets = np.diff(close, prepend=close[0]) / np.r_[1, close[:-1]]
pnl = sig * rets
print('sum_pnl', float(pnl.sum()))
print('vectorbt: Portfolio.from_signals when installed')
print('Educational only. Not investment advice.')
Run it in a throwaway venv. If an import is missing, install only what you need for tonight—do not boil the ocean.
You can explain NumPy-speed vectorized backtests for research iteration in two sentences, show one chart or printout, and list one risk. That is enough progress for an after-work session.
Tomorrow, connect this tool to the adjacent skill (data hygiene, validation, or a simple dashboard)—still educational, still not investment advice.
Educational only. Not investment advice.
pip show) so you can reproduce tomorrow.scratch/ folder; do not mix experiments with production paths.