Purging overlapping labels in a walk-forward backtest
Keep future outcomes out of training when the target spans several days. Correctly dated features only solve part of the problem.
Wall Street Playbook ·
Inspect a split boundary
A model predicts returns over the next five trading sessions. The test starts at session 100. A training observation at session 97 needs outcomes through session 102, so its label includes test-period data. A training observation at session 94 ends at session 99 and can be used under a strict end-before-test rule.
Write the fold test
For each training row, record both feature time and label end time. Require the training label to finish before the test starts. Fit transformations on the remaining training rows. Verify the split manually on one date where the outcome crosses a holiday or weekend. The gap follows the label horizon, which may differ from five calendar days.
Quantitative Finance Interview Playbook
Get the complete guide when you’re ready for more practice.
Sale price $50.15 Original price $59