Skip to main content
live in the browser point-in-time walk-forward

Cross-sectional momentum, in a browser tab.

A deterministic backtest on a synthetic universe. The signal ranks tickers by past log-return over a lookback window, goes long the top quantile and short the bottom, holds for N bars, and pays transaction costs on every turnover. Move the sliders and watch the equity curve, Sharpe, and drawdown redraw — the same evaluation loop you'd build in production, just on a toy universe.

sharpe
ann. return
ann. vol
max drawdown
turnover / reb.
equity curve · strategy vs equal-weight benchmark
strategy benchmark
mean min max frac > 0

Same params, ten different seeds on the synthetic universe. Bars above zero are green; below, red. A single Sharpe number from one seed is mostly noise; the spread is what tells you whether the strategy is real on this universe.

how this is wired

runBacktest() in src/lib/backtest.ts is a single ~150-line function with no I/O and a deterministic RNG — two reasons it's easy to test, fast to draw, and trivial to port to a notebook for offline analysis.

The synthetic universe has a shared market factor + a slow-drifting per-ticker "skill" sine, which is just enough structure for momentum to find something. Real features and a real universe slot into the same loop — this page is the loop, not the strategy.

Signals form on a closed window ending at t-1, applied to returns at t. That's the point-in-time contract.