BDLOB: Bayesian Deep Convolutional Neural Networks for Limit Order Books

Zihao Zhang, Stefan Zohren, Stephen RobertsarXiv 2018 · DOI · arXiv

Abstract: We showcase how dropout variational inference can be applied to a large-scale deep learning model that predicts price movements from limit order books (LOBs), the canonical data source representing trading and pricing movements. We demonstrate that uncertainty information derived from posterior predictive distributions can be utilised for position sizing, avoiding unnecessary trades and improving profits. Further, we test our models by using millions of observations across several instruments and markets from the London Stock Exchange. Our results suggest that those Bayesian techniques not only deliver uncertainty information that can be used for trading but also improve predictive performance as stochastic regularisers. To the best of our knowledge, we are the first to apply Bayesian networks to LOBs.

Introduction

In high-frequency trading, the Limit Order Book (LOB) serves as the primary record of market supply and demand. Despite its importance, LOB data is characterized by extreme noise and non-stationarity. While state-of-the-art deep learning models like CNNs and LSTMs have improved predictive accuracy, they typically provide only point estimates. In financial markets, the inability to quantify model uncertainty can lead to significant risk. This paper introduces BDLOB, a Bayesian approach that quantifies uncertainty to optimize trading decisions.

Methodology

BDLOB builds upon the DeepLOB architecture, which utilizes convolutional layers for feature extraction and LSTMs for temporal dependencies. To transform this into a Bayesian model, we employ Dropout Variational Inference (Monte-Carlo Dropout). By maintaining active dropout during inference and performing multiple stochastic forward passes, we generate a posterior predictive distribution.

From this distribution, we calculate Predictive Entropy ($\mathbb{H}$) to represent model uncertainty. This metric is then integrated into a Bayesian Trading Strategy:

  • High Certainty (Low $\mathbb{H}$): Increase position size (1.5x).
  • Medium Certainty: Standard position size.
  • Low Certainty (High $\mathbb{H}$): Reduce position size (0.5x) or avoid the trade entirely.

Experimental Setup

The model was evaluated using a massive dataset from the London Stock Exchange (LSE) from 2017, encompassing over 134 million market quotes across five major stocks: Lloyds Bank (LLOY), Barclays (BARC), Tesco (TSCO), BT, and Vodafone (VOD). The data was split into 6 months for training, 3 months for validation, and 3 months for out-of-sample testing.

Key Results

Predictive Performance

BDLOB consistently outperformed baseline models in predictive accuracy. The use of dropout during training acted as a stochastic regularizer, improving the model's generalization capabilities. Notably, BDLOB demonstrated a superior ability to identify "stationary" market conditions, which is critical for avoiding unprofitable trades in flat markets.

Predictive accuracy comparison across five LSE stocks.

Profitability and Risk Management

Backtesting revealed that the Bayesian trading strategy significantly enhanced profitability across all tested instruments. By using predictive entropy as a risk filter, the strategy amplified positive returns without a proportional increase in risk. The BDLOB_bayesian variant, which utilizes uncertainty for position sizing, achieved the highest cumulative profits compared to standard softmax-based or non-Bayesian strategies.

Profit comparison highlighting the performance of the Bayesian trading strategy.

Conclusion

BDLOB represents the first application of Bayesian Neural Networks to LOB data. Our findings indicate that quantifying uncertainty is not only possible in high-frequency environments but also highly beneficial for risk-adjusted returns. Future work will explore more advanced Bayesian techniques, such as weight-perturbation, and the impact of transaction costs on strategy execution.

Summary updated

Abstract

We showcase how dropout variational inference can be applied to a large-scale deep learning model that predicts price movements from limit order books (LOBs), the canonical data source representing trading and pricing movements. We demonstrate that uncertainty information derived from posterior predictive distributions can be utilised for position sizing, avoiding unnecessary trades and improving profits. Further, we test our models by using millions of observations across several instruments and markets from the London Stock Exchange. Our results suggest that those Bayesian techniques not only deliver uncertainty information that can be used for trading but also improve predictive performance as stochastic regularisers. To the best of our knowledge, we are the first to apply Bayesian networks to LOBs.
BibTeX
@misc{zhang2018bdlob,
  author = {Zihao Zhang and Stefan Zohren and Stephen Roberts},
  title = {{BDLOB: Bayesian Deep Convolutional Neural Networks for Limit Order Books}},
  year = {2018},
  eprint = {1811.10041},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1811.10041},
}
Figure