Scripts Python
lookahead-guard — Look-Ahead Bias Detector for Quant Backtests
Cette annonce est affichée dans sa langue d'origine (anglais).
Mechanically prove your backtest is not peeking at the future.
Ce que vous recevez : 1 fichier · 31.58 KB · ZIP
Voir les options d'achatDescription du produit
The bug that silently improves your backtest
scipy.ndimage.minimum_filter1d(x, 20) looks innocent. Its default origin=0 makes it a centered window [t-10, t+9] — it reads 9 future days, runs without error or warning, and only makes the equity curve prettier. One missing parameter once invalidated 14 rounds of research.
lookahead-guard turns "this isn't a lookahead bug, right?" from a prayer into a re-runnable gate.
Four independent layers
A — Primitive semantics. Does this rolling/filter primitive equal the true trailing window
[t-n+1, t]? Compared cell-by-cell against a reference implementation for a=1..30.B — Future-blind test (the only decisive one). Perturb data after time t; if any output at or before t changes, it is a lookahead bug. Depends on no returns, no assumptions.
C — Static AST sentinel. Flags centered windows, negative shift, full-sample standardization, bfill, random splits.
D — Permutation test. Uses a circular-shift null rather than naive shuffling — naive shuffling destroys autocorrelation and yields optimistic p-values.
What it does not do
It does not predict returns, rank strategies, or promise profit. It answers exactly one question: does this code or signal peek at the future?
Install
pip install lookahead-guard
pip install "lookahead-guard[full]" # adds pandas/scipy for the B layerHonest boundaries — please read
Layer C is a heuristic, not a proof. Passing C does not mean you are clean; B is the real test.
full-sample-statdeliberately marks cross-sectional statistics MEDIUM, because that pattern is often legitimate.negative-shiftalone is usually innocent —shift(-1)is standard when building forward-return labels.Layer A must compare against the same window. An earlier version compared against
len(a)instead ofnand became a new contamination source; there is a regression test for that bug.
MIT licensed. Pure Python, no network calls, no telemetry, runs fully offline.
Ce que vous recevez
1 fichier · 31.58 KB
- lookahead-guard-0.1.0.zipZIP · 31.58 KB
Scripts Python
lookahead-guard — Look-Ahead Bias Detector for Quant Backtests
Cette annonce est affichée dans sa langue d'origine (anglais).
Mechanically prove your backtest is not peeking at the future.
Inclus dans Getly ProPasser à Pro
Questions fréquentes
Ai-je accès au produit immédiatement ?
Oui. C'est un produit numérique : vous pouvez le télécharger juste après le paiement, directement depuis votre bibliothèque.
Puis-je l'utiliser pour des projets commerciaux ?
Oui. L'usage commercial est autorisé : utilisez-le dans votre propre activité et dans ce que vous vendez. Vous ne pouvez pas revendre ni redistribuer le fichier lui-même.
Quelle est votre politique de remboursement ?
Vous pouvez demander un remboursement dans un délai de 30 jours. Si quelque chose ne va pas, demandez-le depuis votre commande et l'équipe Getly l'examine.
Quels formats et quelles tailles de fichier vais-je recevoir ?
Vous téléchargerez 1 fichier - ZIP - 31.58 KB au total.
Ai-je droit aux mises à jour gratuites ?
Oui : quand le vendeur publie une nouvelle version, vous pouvez retélécharger les derniers fichiers depuis votre bibliothèque sans frais. Consultez le journal des modifications pour les dernières mises à jour.
Prix
$19.00

