Backtest
Backtest
Validation Checks
Lists model validation safeguards used to prevent leakage and calculation errors.
The backtest framework includes integrity checks to reduce leakage risk and arithmetic drift.
Weight Sum Validation
Each window's normalized weights must sum to 1.0 within tolerance.
assert np.isclose(weight_sum, 1.0, atol=1e-5)Forward-Leakage Test
Future rows are masked in probe tests; weights at probe timestamps must remain unchanged.
for probe in sample_dates:
masked_df = df.copy()
masked_df.loc[masked_df.index > probe, :] = np.nan
assert weights_match(masked_df, full_df, at=probe)Win Rate Requirement
Operational benchmark requires aggregate win rate >= 50% against uniform DCA.