Skip to main content Accessibility help
×
Hostname: page-component-76d6cb85b7-lcgwf Total loading time: 0 Render date: 2026-07-14T09:02:18.613Z Has data issue: false hasContentIssue false

Deep Learning in Quantitative Trading

Published online by Cambridge University Press:  03 October 2025

Zihao Zhang
Affiliation:
University of Oxford
Stefan Zohren
Affiliation:
University of Oxford

Summary

This Element provides a comprehensive guide to deep learning in quantitative trading, merging foundational theory with hands-on applications. It is organized into two parts. The first part introduces the fundamentals of financial time-series and supervised learning, exploring various network architectures, from feedforward to state-of-the-art. To ensure robustness and mitigate overfitting on complex real-world data, a complete workflow is presented, from initial data analysis to cross-validation techniques tailored to financial data. Building on this, the second part applies deep learning methods to a range of financial tasks. The authors demonstrate how deep learning models can enhance both time-series and cross-sectional momentum trading strategies, generate predictive signals, and be formulated as an end-to-end framework for portfolio optimization. Applications include a mixture of data from daily data to high-frequency microstructure data for a variety of asset classes. Throughout, they include illustrative code examples and provide a dedicated GitHub repository with detailed implementations.

Information

Figure 0

Figure 1 Left: histogram for the return distribution; Right: QQ-plot.Figure 1 long description.

Figure 1

Code 1.1

Figure 2

Figure 2 Left: ACF plot; Right: PACF plot.Figure 2 long description.

Figure 3

Code 1.2

Figure 4

Figure 3 Returns of the S&P 500 over 60 years.

Figure 5

Table 1 Objective functions for regression problems.Table 1 long description.

Figure 6

Code 1.3

Figure 7

Table 2 Confusion matrix.Table 2 long description.

Figure 8

Table 3 Evaluation metrics for classification problems.Table 3 long description.

Figure 9

Code 1.4

Figure 10

Figure 4 An example of different ROC curves.Figure 4 long description.

Figure 11

Figure 5 An FCN with two hidden layers in which each hidden layer has five neurons.

Figure 12

Code 1.5

Figure 13

Figure 6 Plots of various activation functions.

Figure 14

Figure 7 Top: an illustration of padding; Bottom: an illustration of stride.

Figure 15

Figure 8 An example CNNs network that first goes through a convolutional layer and then a pooling layer with a fully connected layer at the end.

Figure 16

Figure 9 A WaveNet with three layers. The dilation factors for the first, second, and third hidden layers are 1, 2, and 4 respectively.

Figure 17

Figure 10 The network structure of a WaveNet. The input is convolved in the first layer and then fed to the following network layer with a residual connection. The Condition refers to any other external information that the network uses. This operation is repeated until the output layer L(M) and the final forecast is made.Figure 10 long description.

Figure 18

Figure 11 A recurrent network that processes information from the input and the past hidden state.

Figure 19

Figure 12 An illustration of an LSTM cell.

Figure 20

Figure 13 A typical example of a Seq2Seq network.

Figure 21

Figure 14 An example of Attention.

Figure 22

Figure 15 The Transformer model architecture as first introduced in Vaswani et al. (2017).Figure 15 long description.

Figure 23

Figure 16 Groups of time-series transformers based on application domains and attention modules.

Figure 24

Figure 17 Categorization based on attention modules: point-wise, patch-wise, and series-wise. Examples of models that employ each of those attention types respectively are the Informer, PatchTST, and iTransformer.

Figure 25

Figure 18 A graph convolution layer that pools information for node A from its neighbors.Figure 18 long description.

Figure 26

Figure 19 A GCNs that consists of multilayers.Figure 19 long description.

Figure 27

Figure 20 Top: a “node-level” prediction task; Bottom: a “graph-level” prediction task.

Figure 28

Figure 21 Key steps of the model training workflow.

Figure 29

Figure 22 A visual example of under and overfitting with polynomials.

Figure 30

Figure 23 Left: traditional U-shaped overfitting curve; Right: double descent error curve.Figure 23 long description.

Figure 31

Figure 24 Cross-validation for time-series.

Figure 32

Figure 25 Top: price series generated by a nearest futures contract approach; Bottom: price series generated by a continuous futures contract approach.Figure 25 long description.

Figure 33

Figure 26 Long-only benchmark S&P 500 strategy and an accompanying version that incorporates volatility targeting of 15% annual standard deviation.Figure 26 long description.

Figure 34

Figure 27 A heatmap of correlation matrix among various futures contracts.

Figure 35

Code 1.6

Figure 36

Table 4 Performance metrics – raw signal outputs.Table 4 long description.

Figure 37

Table 5 Performance metrics – rescaled to target volatility.Table 5 long description.

Figure 38

Table 6 Performance metrics – raw signal outputs.Table 6 long description.

Figure 39

Figure 28 These figures compare the performance of variants of the momentum transformer strategy with benchmarks for the 2015–2020 period (left) and the COVID-19 crisis (right). In each plot, we display cumulative returns adjusted to an annualized volatility level of 15%.Figure 28 long description.

Figure 40

Table 7 Decoder-Only TFT average variable importance.Table 7 long description.

Figure 41

Figure 29 Variable importance for Cocoa futures during out-of-sample forecasting from 2015 to 2020 is illustrated in the accompanying figures. The upper plot displays the price series, while the lower plot showcases the Decoder-Only TFT model. To emphasize the most significant features, we highlight the seven variables with the highest average weights.Figure 29 long description.

Figure 42

Figure 30 LTR for cross-sectional momentum strategy.Figure 30 long description.

Figure 43

Figure 31 Cumulative returns – rescaled to target volatility annualized volatility of 15%.Figure 31 long description.

Figure 44

Table 8 Performance metrics – rescaled to target annualized volatility of 15%.Table 8 long description.

Figure 45

Figure 32 Architecture of the proposed end-to-end framework.Figure 32 long description.

Figure 46

Table 9 Performance metrics.Table 9 long description.

Figure 47

Figure 33 A graph built from adjacency matrix of futures contracts.

Figure 48

Figure 34 A graph built from a news network. Colors indicate that assets are allocated to the same group.

Figure 49

Figure 35 A snapshot of LOB at time t.

Figure 50

Table 10 An example of a sequence of market by order data.Table 10 long description.

Figure 51

Figure 36 This illustration demonstrates how MBO data modifies a LOB. Top: A new limit order is introduced; Middle top: An existing order is canceled; Middle bottom: An order undergoes a partial cancellation; Bottom: A marketable buy limit order crosses the spread.

Figure 52

Figure 37 Limit order book data across times.

Figure 53

Figure 38 An attention model that utilizes limit order books for multi-horizon forecasting.

Figure 54

Figure 39 A schematic description of RL.Figure 39 long description.

Figure 55

Figure 40 A brief comparison between the baseline strategy and RL policy for AAPL on 2012-06-14. New limit orders that are not immediately executed are represented by circles, executed trades by crosses, and order cancellations by triangles. Lines connect open orders to their corresponding cancellations or executions.

Figure 56

Figure 41 The distribution of executed volume per time step, with the horizontal axis representing the time step, vertical axis indicating the volume, and columns corresponding to different execution strategies. The box plots show the interquartile ranges, medians (marked by orange lines), means (indicated by blue triangles), and the 10th and 90th percentiles (represented by whiskers).

Figure 57

Figure 42 Price trajectories and the associated percentiles of terminal prices for both real and generated data.Figure 42 long description.

Figure 58

Figure 43 The distributions of mid-price returns for generated (blue) and realized (red) data with the mean (solid lines) and 95% confidence intervals (shaded regions). Left: Google; Right: Intel.Figure 43 long description.

Figure 59

Figure 44 Top: Pearson correlation coefficient ρ between the generated and actual returns, reflecting the performance of directional forecasting; Bottom: the corresponding p-values. Left: Google; Right: Intel.Figure 44 long description.

Save element to Kindle

To save this element to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Deep Learning in Quantitative Trading
Available formats
×

Save element to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Deep Learning in Quantitative Trading
Available formats
×

Save element to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Deep Learning in Quantitative Trading
Available formats
×