Inzichten en nieuws

Blog

Diepgaande verkenningen van AI-handel, marktanalyse en de toekomst van DeFi.

Browse collections →
Filter by tag:
July 2, 2026
#algotrading

De framework-belasting: wanneer je backtestbibliotheek trager is dan een naïeve pandas-loop

We hebben acht backtest-engines gebenchmarkt op één identieke parameter-sweep — 150k bars, 80 HMA-cross-combinaties, trade-count-pariteit vastgezet op 2707. Twee van de populairste event-driven frameworks kwamen trager uit dan een met de hand geschreven pandas-loop, terwijl een gevectoriseerde/gecompileerde engine hetzelfde werk ~13,000× sneller draaide. Een studie van de per-bar overhead die populaire bibliotheken nooit gebouwd waren om te amortiseren.

#algotrading#backtest#prestaties
Lees artikel →
July 1, 2026
#algotrading

The Probability of Backtest Overfitting: Did Your Search Beat a Coin Flip?

The Deflated Sharpe Ratio prices the winning strategy; PBO prices the search that picked it. Combinatorially Symmetric Cross-Validation runs C(16,8) = 12,870 train/test splits over a 1000x200 performance matrix and asks: does the in-sample winner land in the bottom half out of sample? The catch almost everyone misses — PBO's null is 0.5, not 1. On 200 zero-edge strategies the best in-sample annualized Sharpe of 1.98 collapses to 0.06 out of sample and PBO = 0.476: a coin flip, fully overfit. Plant a real edge (annualized Sharpe 2.38) and PBO drops to 0.001, the in-sample 3.73 surviving to an out-of-sample 2.34. A moving-average grid on a pure random walk has no out-of-sample skill either — PBO 0.463 averaged over 60 matrices, statistically indistinguishable from the null — and on one representative matrix the mirage is vivid: a best in-sample Sharpe of 2.33 collapses to a median out-of-sample -0.22, PBO 0.573, a 63% chance of a loss.

#algotrading#backtest#overfitting
Lees artikel →
June 30, 2026
#algotrading

The IPC Tax: Put the Backtest Engine Behind a Socket and Lose 13% — Almost None of It to the Socket

We ported a numba backtest kernel line-for-line to Rust and called it across a process boundary four ways, with an equivalence gate confirming identical PnL to the last trade. Shipping the entire 1.2 MB price series through a Unix socket costs ~2 ms — about 0.1% of the job. JSON-encoding the same payload costs 1348x more than raw bytes, chatty per-combo calls re-ship the data 80 times, and a per-bar call pattern would pay 2.1 s of pure IPC on a 2.0 s job. The boundary is cheap; the tax is in how you cross it.

#algotrading#backtest#performance
Lees artikel →
June 29, 2026
#algotrading

The Deflated Sharpe Ratio: How Many of Your Backtest 'Winners' Survive Multiple Testing?

A parameter search is a machine for manufacturing luck. On pure noise — 1,000 strategies with zero true edge — the best annual Sharpe averages 1.63 and the naive significance test flags a discovery 100% of the time. We build controlled ground truth and show that the Deflated Sharpe Ratio, the Harvey-Liu haircut, and White's Reality Check restore honesty: false discoveries drop from 1.000 to 0.001-0.057, genuine edges above the noise ceiling are kept with power ~1 — and one real trap (correlated grids) where the raw DSR over-deflates and the verdict must be read across a whole band of effective-trial estimates, not one.

#algotrading#backtest#overfitting
Lees artikel →
June 28, 2026
#algotrading

Objective-Function Design: The Metric You Optimize Secretly Picks Your Strategy

To search for the 'best' strategy you must first define 'best' — and that scalar silently chooses the winner. On synthetic data with a known edge (600 seeds, T=2000, 80 thresholds), a naive per-trade Sharpe crowns a lottery: it picks a sub-5%-exposure winner in 56% of seeds and degenerates in 57% — on the starkest seed, 8 trades posting an in-sample Sharpe of 21.09 that collapses to 0.13 out of sample. The honest repair is almost dull: measure on the full timeline, which never degenerates (out-of-sample 1.71). A trade-count (conf_k) shrinkage and an exposure floor can retrofit a per-trade metric, but even fully repaired they only match full-timeline Sharpe (1.70 vs 1.71) — never beat it. Goodhart's law, in a backtest, with controlled ground truth.

#algotrading#backtest#overfitting
Lees artikel →
June 26, 2026
#algotrading

The Backtest Speed Ladder: 298x on a Laptop CPU, Identical PnL to the Last Trade

Five implementations of the same 80-combo parameter sweep, all verified to produce identical PnL: pandas rolling.apply takes 69.9 seconds, numpy 3.1, numba 2.0, parallel numba 0.23 — a measured 298x speedup on an Apple M2 Max with zero hardware changes, and still ~13x over a competent vectorized baseline. What each rung buys, why a GPU is not the missing piece, and where the real bottleneck in mass parameter search lives.

#algotrading#backtest#performance
Lees artikel →