Neural Networks and Deep Learning
Neural networks power deep learning, from LSTMs to transformers. Learn how they work, where they help in trading, especially with text and images, and their risks.
Neural networks are models built from layers of simple units that each combine their inputs with learned weights and pass the result through a non linear function. Stacked deeply, they can learn very complex patterns, and they drive modern breakthroughs in image recognition, speech and language models. In trading, neural networks are valuable for unstructured data such as news text, filings and images, and they are used by many large firms. For predicting prices from price history alone, though, they often perform no better than simpler models while being much easier to overfit.
How a neural network learns#
- Input layer: receives features, such as recent returns or word embeddings.
- Hidden layers: each unit computes a weighted sum of its inputs and applies an activation function.
- Output layer: produces a prediction, such as a probability or a number.
- Training: the network compares predictions with true values and adjusts weights through backpropagation and gradient descent to reduce error.
Types of networks#
| Type | Designed for | Trading use |
|---|---|---|
| Feedforward (multilayer perceptron) | Fixed sets of features | Combining tabular signals |
| Convolutional (CNN) | Spatial patterns | Satellite images, chart images, order book snapshots |
| Recurrent (RNN, LSTM, GRU) | Sequences | Time series of prices or events |
| Transformers | Long sequences with attention | Language models for news and filings; some time series work |
| Autoencoders | Compressing data | Anomaly detection, latent factors |
Where neural networks help most#
| Use | Why |
|---|---|
| Text and sentiment | Language models understand context far better than word counts. See Social and News Sentiment |
| Earnings calls and filings | Extracting tone, uncertainty and topics. See Earnings Calls |
| Alternative data | Images, receipts, web data. See Alternative Data Explained |
| Limit order book modelling | Short term prediction from rich, high volume data |
| Volatility surfaces and derivatives pricing | Fast approximations of complex pricing models |
Why deep learning struggles on price data#
- Little data: daily prices give only a few thousand points per asset; deep networks often need far more.
- Low signal to noise: networks readily fit noise.
- Non stationarity: patterns change faster than models can learn them. See Stationarity, Differencing and Unit Roots.
- Many settings to tune, each one another chance to overfit. See P-Hacking and Multiple Testing.
Making them work better#
- Use pretrained models for text and images rather than training from scratch.
- Regularise heavily: dropout, weight decay, early stopping and small networks.
- Use more data where possible: many assets, intraday data, ensembles.
- Validate by time with walk forward tests. See Walk-Forward Validation and Preventing Overfitting.
- Compare with simple baselines such as linear models and gradient boosting. Keep the network only if it clearly wins out of sample.
Interpretability#
Neural networks are harder to explain than linear models or trees. Tools such as SHAP values and attention maps help, but in regulated settings firms may prefer simpler models where decisions must be justified. See Operational and Model Risk.
Frequently asked questions#
Do neural networks work for stock prediction?#
They are most useful with rich, unstructured data such as text and images; on price history alone they often perform no better than simpler models.
What is an LSTM in trading?#
A type of recurrent neural network designed to learn from sequences, often tried for time series, though results on prices alone are usually modest.
Should beginners use deep learning for trading?#
It is better to start with simple models and sound validation; deep learning adds complexity and overfitting risk that is hard to manage without experience.
Next, learn which inputs give models a chance in Feature Engineering.
3 quick questions on this lesson. Get them all right to finish it.
Turn on JavaScript to take the quiz.
Mentioned in
- Regression and Classification ModelsMachine Learning
- Calculus for TradersMath and Statistics