Quantitative Finance
Equities, FX, futures. Factors and backtests, every run replayable.
Does the lagged feature carry information about the next day?
series = simulate(seed=13, regime="clustered") spec = Spec("x_lag1", horizon="1d", costs=Costs.linear(bps=7)) gates = Gates(placebo_p=0.05, holdout_ratio=0.50) freeze(spec, gates)
Specification frozen62ec1d3e
explore, holdout = split(series, at=672) curve = backtest(spec, explore) verdict = gates.check(curve, holdout=None)
exploration.test_statistic = 0.86 holdout.test_statistic = None
null = [backtest(spec.shift(k), explore).statistic for k in rng.integers(40, 632, size=240)] p = (sum(v >= curve.statistic for v in null) + 1) / (len(null) + 1)
240 shifted-signal controls. 8 at or above the observed value, p = 0.037.