LSTM Stock Bot
NAME
lstm-stock-bot - LSTM Stock Bot
SYNOPSIS
LSTM + news sentiment stock signals, honestly backtested and paper traded.
DESCRIPTION
A daily S&P 500 direction model: a 2-layer LSTM over 20 sessions of price features and Finnhub headline sentiment (VADER), traded on Alpaca's paper API.
Over a 2-year walk-forward test it was the only strategy that didn't lose money after costs, but its edge isn't statistically significant. Daily large-cap direction is close to a coin flip, and this project is built to measure that honestly.
STACK
Python, PyTorch, SQLite, Alpaca, Finnhub, VADER
HIGHLIGHTS
- End-to-end pipeline in one CLI: Alpaca and Finnhub ingestion, SQLite, 13 features, PyTorch LSTM, backtest, signals, paper orders
- 8 walk-forward folds, a 5-session embargo, train-only normalization, and look-ahead checks that block training on failure
- 50.5% accuracy (95% CI 50.1% to 51.0%) and +0.20% total return net of costs, vs -4.7% for logistic regression and -7.0% for random picks
- Paper-only by construction: the broker client refuses non-paper endpoints and orders are idempotent