← back to projects

LSTM

Nothing beats guessing a zero return. The one real signal shows up on stressful days, when trading costs the most.

capability: Machine learning
category: Machine Learning
date: July 2026
Long-short Sharpe before and after costs on calm and stress days
LightGBM decile long-short, before and after costs, on calm and stress days.

question

Does an LSTM predict daily stock returns better than simple models? 518 S&P 500 stocks, 2005 to 2026.

methodology

  • Strict time order: train to 2021, test from 2023.
  • A model trained on shuffled data runs every time as a leak check.
  • Then a stock-ranking test split into calm and stressful days, with costs.

result

  • The best model barely matches guessing zero. The LSTM does worse.
  • On stressful days, LightGBM ranks stocks with real skill (t = 3.2).
  • That edge earns a 2.1 Sharpe before costs and loses money after them.

figures

  1. Test error of each model against predicting zero
    Figure 1. Test error of each model against predicting a zero return.
  2. Ridge long-short, gross and net
    Figure 2. Ridge long-short over the test period, gross and net of 10 bp a side, stress days shaded.

caveats

  • Today's S&P 500 members only, so survivorship bias is present.

stack

PythonPyTorchLightGBMXGBoostscikit-learnBloomberg VBA

papers and documents