LSTM Forecasting & Walk-Forward Validation

View Repository Source

A 1-minute OHLCV forecasting pipeline enforcing causal EWMA standardization, in which a statistically significant model was not adopted because its edge traced largely to a volatility shortcut.

I built a modular, 1-minute OHLCV forecasting pipeline for SPY/QQQ/VXX. A key focus was ensuring strict causal session-reset EWMA standardization. This guarantees train/serve parity by construction without the risk of retroactively fitting scalers and leaking future data.

Defensive Data Engineering

I enforced strict timezone and session contracts that hard-fail on non-contiguous days or extended-hours data. The pipeline constructed 19 causal features per step, including lead–lag correlation matrices across symbol pairs and log vol-surge interaction terms.

Rejecting the “Winner”

I executed an audited full-history walk-forward A/B test (29 folds/arm) on a remote VPS. The winning fixed-horizon model achieved a statistically significant edge ($p < 10^{-6}$).

However, I did not adopt it or certify it as economically better. A fold-level audit pointed to a volatility-nowcast shortcut: the winner’s edge was largest in quiet periods and faded in uniformly turbulent ones (Spearman $\rho = -0.71$ against fold base rate), which is what ranking “is volatility elevated?” would produce. The volatility-scaled triple-barrier arm, which removes that shortcut by design, scored a smaller but cleaner ROC-AUC of about 0.62. A cross-scoring experiment that would settle the question was launched but its results were not recovered, so the shortcut explanation is strong evidence, not proof. An edge you cannot explain is usually a shortcut; statistical significance is not economic significance.

Outcome

Neither arm is deployed. As a standalone entry signal the winner is not viable: its median precision of about 4% works out to roughly 1 basis point gross per alert, inside round-trip costs. What carries forward is the part that worked: the causal standardization, the session contracts that fail loudly, and a walk-forward harness honest enough to question its own winner.