Concept
LSTM / Recurrent Networks
LSTM / Recurrent Networks are Machine Learning concepts. A reference entry: the Library explains it rather than implements it.
What are LSTMs and recurrent networks?
Recurrent networks are neural networks built for sequences: they process one step at a time while carrying a hidden state forward, so earlier bars influence how later bars are read. The LSTM (long short-term memory), introduced by Hochreiter and Schmidhuber in 1997, adds gated memory cells that learn what to keep, update, and forget, countering the vanishing-gradient problem that made plain recurrent nets forget long-range context. The GRU is a lighter variant with similar behavior.
In financial machine learning, LSTMs were the default sequence model of the mid-2010s wave: fed windows of returns and engineered inputs (see feature engineering) to predict next-period direction, return, or volatility. What the network is asked to predict matters as much as the architecture, which is the territory of label definition and prediction horizon.
The honest track record is sobering. On liquid markets, LSTMs regularly fail to beat much simpler baselines once evaluated strictly out of sample with costs, and attention-based architectures have displaced them across most of the research literature. They remain a reasonable tool where sequence memory genuinely helps, notably volatility, which is far more persistent than returns.
Why there's no indicator for this
An LSTM is not a formula; it is a trained artifact. Producing one requires machinery no charting engine contains: a large labeled dataset, time-ordered train/validation/test splits, feature scaling fitted only on past data, compute-heavy optimization, and scheduled retraining as markets drift, the problem online and incremental learning exists to manage. A chart script sees one symbol's loaded history and none of that pipeline.
Scripts marketed as on-chart LSTMs therefore do one of two things. Either they ship tiny frozen weights, meaning you run a stale model trained at an unknown time on unknown data, or they fit themselves to the visible chart history, which is in-sample curve fitting that looks prophetic backward and fails forward. Neither delivers the validated out-of-sample behavior that justifies using a learned model at all.
How traders use it
- Volatility and direction forecasting research, where LSTM outputs are benchmarked against classical models; volatility is the friendlier target because it clusters and persists.
- Learned compression: a trained network's hidden state summarizes a sequence into a vector that feeds downstream models or an ensemble vote.
- Regime-aware stacks: pipelines gate network outputs by market state from Markov-switching models, trusting the net only in regimes resembling its training data.
- Probability outputs: classification variants emit scores that pass through calibration before anyone sizes a position off them.
LSTMs vs adjacent sequence models
Neural Networks: Feedforward nets map a fixed snapshot of inputs to an output; recurrent nets carry state across time steps, buying sequence memory at the cost of harder, slower training.
Hidden Markov / Markov-switching Regimes: Both model sequences through hidden state, but an HMM uses a few interpretable discrete states estimated statistically, while an LSTM learns thousands of opaque continuous parameters.
Related concepts · Learned models
Concept family
Machine Learning
32 concepts mapped · 21 in the Library
LSTM / Recurrent Networks FAQ
Are LSTMs good at predicting stock prices?
Published results are mixed at best. Prices are noisy and non-stationary, so the long-memory advantage rarely survives out-of-sample testing after costs. Results improve on volatility and on tasks with richer inputs than bare price.
Why do LSTM backtests look great and then fail live?
Usually leakage (scaling or tuning touched future data), overfitting a small noisy sample, or a regime the frozen weights never saw. Strict walk-forward evaluation catches much of this beforehand.
LSTM or GRU?
For most financial tasks the difference is minor. GRUs train faster with fewer parameters and reach similar accuracy; data quality and labeling choices dominate the architecture choice.
Have transformers replaced LSTMs?
In research, largely yes: attention handles long context better and trains in parallel. LSTMs persist where datasets are small or where latency and simplicity matter.
Build LSTM / Recurrent Networks your way.
Quant writes, tests, and refines it with you — then it runs on LuxAlgo charting or ports to TradingView.