Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
158 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
45 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Deep Limit Order Book Forecasting (2403.09267v4)

Published 14 Mar 2024 in q-fin.TR and cs.LG

Abstract: We exploit cutting-edge deep learning methodologies to explore the predictability of high-frequency Limit Order Book mid-price changes for a heterogeneous set of stocks traded on the NASDAQ exchange. In so doing, we release `LOBFrame', an open-source code base to efficiently process large-scale Limit Order Book data and quantitatively assess state-of-the-art deep learning models' forecasting capabilities. Our results are twofold. We demonstrate that the stocks' microstructural characteristics influence the efficacy of deep learning methods and that their high forecasting power does not necessarily correspond to actionable trading signals. We argue that traditional machine learning metrics fail to adequately assess the quality of forecasts in the Limit Order Book context. As an alternative, we propose an innovative operational framework that evaluates predictions' practicality by focusing on the probability of accurately forecasting complete transactions. This work offers academics and practitioners an avenue to make informed and robust decisions on the application of deep learning techniques, their scope and limitations, effectively exploiting emergent statistical properties of the Limit Order Book.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (112)
  1. Trades, quotes and prices: financial markets under the microscope. Cambridge University Press, 2018.
  2. Limit order books. Cambridge University Press, 2016.
  3. An ecological perspective on the future of computer trading. Quantitative Finance, 13(3):325–346, 2013.
  4. How markets slowly digest changes in supply and demand. In Handbook of financial markets: dynamics and evolution, pages 57–160. Elsevier, 2009.
  5. How market ecology explains market malfunction. Proceedings of the National Academy of Sciences, 118(26):e2015574118, 2021.
  6. Market microstructure in practice. World Scientific, 2018.
  7. BMO Capital Markets. The impact of high frequency trading on the canadian market. Quantitative Execution Services Report, 2009.
  8. Frank Zhang. High-frequency trading, stock volatility, and price discovery. Available at SSRN 1691679, 2010.
  9. The impact of high-frequency trading on markets. CFA Magazine, 22(2):10–11, 2011.
  10. A dysfunctional role of high frequency trading in electronic markets. International Journal of Theoretical and Applied Finance, 15(03):1250022, 2012.
  11. Where is the value in high frequency trading? The Quarterly Journal of Finance, 2(03):1250014, 2012.
  12. Matthew Dixon. Sequence classification of the limit order book using recurrent neural networks. Journal of computational science, 24:277–286, 2018.
  13. Justin A Sirignano. Deep learning for limit order books. Quantitative Finance, 19(4):549–570, 2019.
  14. Deep learning modeling of limit order book: A comparative perspective. arXiv preprint arXiv:2007.07319, 2020.
  15. Deeplob: Deep convolutional neural networks for limit order books. IEEE Transactions on Signal Processing, 67(11):3001–3012, 2019.
  16. Maureen O’hara. Market microstructure theory. John Wiley & Sons, 1998.
  17. Lob-based deep learning models for stock price trend prediction: A benchmark study. arXiv preprint arXiv:2308.01915, 2023.
  18. Deep reinforcement learning for active high frequency trading. arXiv preprint arXiv:2101.07107, 2021.
  19. Jürg Niehans. Transaction costs. In Money, pages 320–327. Springer, 1989.
  20. Ananth Madhavan. Market microstructure: A survey. Journal of financial markets, 3(3):205–258, 2000.
  21. Market microstructure: A survey of microfoundations, empirical results, and policy implications. Journal of Financial Markets, 8(2):217–264, 2005.
  22. Fabrizio Lillo. Order flow and price formation. arXiv preprint arXiv:2105.00521, 2021.
  23. A continuous and efficient fundamental price on the discrete order book grid. Physica A: Statistical Mechanics and its Applications, 503:698–713, 2018.
  24. An empirical behavioral model of price formation. arXiv preprint physics/0509194, 2005.
  25. Bid, ask and transaction prices in a specialist market with heterogeneously informed traders. Journal of financial economics, 14(1):71–100, 1985.
  26. Albert S Kyle. Continuous auctions and insider trading. Econometrica: Journal of the Econometric Society, pages 1315–1335, 1985.
  27. Exogenous and endogenous price jumps belong to different dynamical classes. Journal of Statistical Mechanics: Theory and Experiment, 2022(2):023403, 2022.
  28. Studies of the limit order book around large price changes. The European Physical Journal B, 71:499–510, 2009.
  29. Price jump prediction in limit order book. arXiv preprint arXiv:1204.1381, 2012.
  30. Price dynamics in a markovian limit order market. SIAM Journal on Financial Mathematics, 4(1):1–25, 2013.
  31. Self-organised criticality in high frequency finance: the case of flash crashes. arXiv preprint arXiv:2110.13718, 2021.
  32. Heterogeneous criticality in high frequency finance: a phase transition in flash crashes. Entropy, 24(2):257, 2022.
  33. Market microstructure design and flash crashes: A simulation approach. Journal of Applied Economics, 16(2):223–250, 2013.
  34. The flash crash: High-frequency trading in an electronic market. The Journal of Finance, 72(3):967–998, 2017.
  35. Effects of limit order book information level on market stability metrics. Journal of Economic Interaction and Coordination, 12:221–247, 2017.
  36. The price impact of order book events: market orders, limit orders and cancellations. Quantitative Finance, 12(9):1395–1419, 2012.
  37. The price impact of order book events. Journal of financial econometrics, 12(1):47–88, 2014.
  38. High-frequency trading in a limit order book. Quantitative Finance, 8(3):217–224, 2008.
  39. Agent-based models for latent liquidity and concave price impact. Physical Review E, 89(4):042805, 2014.
  40. Enhancing trading strategies with order book signals. Applied Mathematical Finance, 25(1):1–35, 2018.
  41. Optimal execution with limit and market orders. Quantitative Finance, 15(8):1279–1291, 2015.
  42. Limit order strategic placement with adverse selection risk and the role of latency. Market Microstructure and Liquidity, 3(01):1750009, 2017.
  43. Empirical analysis of limit order markets. The Review of Economic Studies, 71(4):1027–1063, 2004.
  44. Econophysics review: I. empirical facts. Quantitative Finance, 11(7):991–1012, 2011.
  45. Deep order flow imbalance: Extracting alpha at multiple horizons from the limit order book. Mathematical Finance, 33(4):1044–1081, 2023.
  46. Daily volume forecasting using high frequency predictors. In Proceedings of the 10th IASTED International Conference, volume 674, page 248, 2010.
  47. Identifying expensive trades by monitoring the limit order book. Journal of Forecasting, 36(3):273–290, 2017.
  48. Effects of the limit order book on price dynamics. Available at SSRN 2523643, 2014.
  49. Designating market maker behaviour in limit order book markets. Econometrics and Statistics, 5:20–44, 2018.
  50. Using deep learning to detect price change indications in financial markets. In 2017 25th European signal processing conference (EUSIPCO), pages 2511–2515. IEEE, 2017.
  51. Time-series classification using neural bag-of-features. In 2017 25th European Signal Processing Conference (EUSIPCO), pages 301–305. IEEE, 2017.
  52. Machine learning for forecasting mid-price movements using limit order book data. Ieee Access, 7:64722–64736, 2019.
  53. Using deep learning for price prediction by exploiting stationary limit order book features. Applied Soft Computing, 93:106401, 2020.
  54. Temporal attention-augmented bilinear network for financial time-series data analysis. IEEE transactions on neural networks and learning systems, 30(5):1407–1418, 2018.
  55. Data normalization for bilinear structures in high-frequency financial time-series. In 2020 25th International Conference on Pattern Recognition (ICPR), pages 7287–7292. IEEE, 2021.
  56. Temporal logistic neural bag-of-features for financial time series forecasting leveraging limit order book data. Pattern Recognition Letters, 136:183–189, 2020.
  57. Multi-horizon forecasting for limit order books: Novel deep learning approaches and hardware acceleration using intelligent processing units. arXiv preprint arXiv:2105.10430, 2021.
  58. Forecasting the mid-price movements with high-frequency lob: A dual-stage temporal attention-based deep learning architecture. Arabian Journal for Science and Engineering, 48(8):9597–9618, 2023.
  59. Machine learning for market microstructure and high frequency trading. High Frequency Trading: New Realities for Traders, Markets, and Regulators, 2013.
  60. Reinforcement learning for optimized trade execution. In Proceedings of the 23rd international conference on Machine learning, pages 673–680, 2006.
  61. Market making with signals through deep reinforcement learning. IEEE Access, 9:61611–61622, 2021.
  62. Pankaj Kumar. Deep reinforcement learning for market making. In Proceedings of the 19th International Conference on Autonomous Agents and MultiAgent Systems, pages 1892–1894, 2020.
  63. Pankaj Kumar. Deep reinforcement learning for high-frequency market making. In Asian Conference on Machine Learning, pages 531–546. PMLR, 2023.
  64. Reinforcement learning approaches to optimal market making. Mathematics, 9(21):2689, 2021.
  65. Jax-lob: A gpu-accelerated limit order book simulator to unlock large scale reinforcement learning for trading. In Proceedings of the Fourth ACM International Conference on AI in Finance, pages 583–591, 2023.
  66. Asynchronous deep double duelling q-learning for trading-signal execution in limit order book markets. arXiv preprint arXiv:2301.08688, 2023.
  67. Modelling limit order trading with a continuous action policy for deep reinforcement learning. Neural Networks, 2023.
  68. Diversity-driven knowledge distillation for financial trading using deep reinforcement learning. Neural Networks, 140:193–202, 2021.
  69. Deep reinforcement learning for financial trading using price trailing. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 3067–3071. IEEE, 2019.
  70. Benchmark dataset for mid-price forecasting of limit order book data with machine learning methods. Journal of Forecasting, 37(8):852–866, 2018.
  71. Finrl-meta: Market environments and benchmarks for data-driven financial reinforcement learning. Advances in Neural Information Processing Systems, 35:1835–1849, 2022.
  72. Predicting stock price changes based on the limit order book: a survey. Mathematics, 10(8):1234, 2022.
  73. Dependency structures in cryptocurrency market from high to low frequency. Entropy, 24(11):1548, 2022.
  74. Anatomy of a stablecoin’s failure: The terra-luna case. Finance Research Letters, 51:103358, 2023.
  75. Ftx’s downfall and binance’s consolidation: the fragility of centralized digital finance. arXiv preprint arXiv:2302.11371, 2023.
  76. The short-term predictability of returns in order book markets: a deep learning perspective. arXiv preprint arXiv:2211.13777, 2022.
  77. How and when are high-frequency stock returns predictable? Technical report, National Bureau of Economic Research, 2022.
  78. NASDAQ. Nasdaq official website. https://www.nasdaq.com. Accessed: 26/12/2023.
  79. LOBSTER Data. What is lobster? https://lobsterdata.com/info/WhatIsLOBSTER.php. Accessed: 26/12/2023.
  80. NASDAQ. Nasdaq stock screener. https://www.nasdaq.com/market-activity/stocks/screener. Accessed: 26/12/2023.
  81. Companies Market Cap. Companies market cap. https://companiesmarketcap.com. Accessed: 24/01/2024.
  82. Forecasting stock prices from the limit order book using convolutional neural networks. In 2017 IEEE 19th conference on business informatics (CBI), volume 1, pages 7–12. IEEE, 2017.
  83. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
  84. An introduction to convolutional neural networks. arXiv preprint arXiv:1511.08458, 2015.
  85. Understanding of a convolutional neural network. In 2017 international conference on engineering and technology (ICET), pages 1–6. Ieee, 2017.
  86. Long short-term memory. Neural computation, 9(8):1735–1780, 1997.
  87. A review on the long short-term memory model. Artificial Intelligence Review, 53:5929–5955, 2020.
  88. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
  89. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
  90. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020.
  91. Karpathy. nanogpt. https://github.com/karpathy/nanoGPT/tree/master. Accessed: 12/01/2024.
  92. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems, 32, 2019.
  93. UCL. Ucl hpc cluster specs. https://hpc.cs.ucl.ac.uk. Accessed: 12/01/2024.
  94. Julius Bonart. What is the optimal tick size? a cross-sectional analysis of execution costs on nasdaq. Available at SSRN http://dx.doi.org/10.2139/ssrn.2869883, 2017.
  95. Towards robust representation of limit orders books for deep learning models. arXiv preprint arXiv:2110.05479, 2021.
  96. Jan Gorodkin. Comparing two k-category assignments by a k-category correlation coefficient. Computational biology and chemistry, 28(5-6):367–374, 2004.
  97. David MW Powers. Evaluation: from precision, recall and f-measure to roc, informedness, markedness and correlation. arXiv preprint arXiv:2010.16061, 2020.
  98. Davide Chicco. Ten quick tips for machine learning in computational biology. BioData mining, 10(1):35, 2017.
  99. Deep lob trading: Half a second please! Expert Systems with Applications, 213:118899, 2023.
  100. Trading with the momentum transformer: an intelligent and interpretable architecture. arXiv preprint arXiv:2112.08534, 2021.
  101. Attention is all you need. Advances in neural information processing systems, 30, 2017.
  102. Are transformers effective for time series forecasting? In Proceedings of the AAAI conference on artificial intelligence, volume 37, pages 11121–11128, 2023.
  103. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of the AAAI conference on artificial intelligence, volume 35, pages 11106–11115, 2021.
  104. Transformers in time series: A survey. arXiv preprint arXiv:2202.07125, 2022.
  105. Deep unsupervised learning using nonequilibrium thermodynamics. In International conference on machine learning, pages 2256–2265. PMLR, 2015.
  106. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840–6851, 2020.
  107. Generative modeling by estimating gradients of the data distribution. Advances in neural information processing systems, 32, 2019.
  108. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, pages 8162–8171. PMLR, 2021.
  109. Homological convolutional neural networks. arXiv preprint arXiv:2308.13816, 2023.
  110. Homological neural networks: A sparse architecture for multivariate complexity. In Topological, Algebraic and Geometric Learning Workshops 2023, pages 228–241. PMLR, 2023.
  111. Topological feature selection: A graph-based filter feature selection approach. arXiv preprint arXiv:2302.09543, 2023.
  112. Sparsification and filtering for spatial-temporal gnn in multivariate time-series. arXiv preprint arXiv:2203.03991, 2022.
Citations (2)

Summary

  • The paper introduces DeepLOB, a hybrid CNN-LSTM framework, to forecast high-frequency mid-price changes in limit order book data.
  • It employs a detailed microstructural analysis by classifying stocks based on tick size, linking liquidity and spread patterns with prediction performance.
  • The research advances an evaluation method beyond traditional metrics, correlating forecasting success with practical trading execution probabilities.

Deep Limit Order Book Forecasting: A Microstructural Approach

Introduction

This paper investigates the predictability of high-frequency mid-price changes in the Limit Order Book (LOB) using deep learning models. A comprehensive approach is adopted, encompassing the analysis of LOB's microstructural properties and the application of state-of-the-art deep learning techniques. The paper introduces LOBFrame, an open-source software designed to efficiently process and model large-scale LOB data, facilitating the quantitative assessment of forecasting capabilities.

Microstructural Analysis

The examination of LOB data is grounded in its microstructural characteristics, focusing on the dynamics at play within a diverse pool of stocks on the NASDAQ exchange. This includes a quantitative method to classify stocks based on their tick size, segregating them into small-tick, medium-tick, and large-tick categories. Such classification yields insights into the liquidity, spread patterns, and informational richness of the LOB, correlating these properties with the subsequent forecasting performance.

Forecasting Methodology

The forecasting framework employed, DeepLOB, integrates Convolutional Neural Networks (CNNs) and Long Short-Term Memory (LSTM) models to capture both spatial and temporal dependencies within LOB data. A detailed process outlines the data preparation, labeling, and training phases, emphasizing the model's adaptability to different prediction horizons and confidence levels. The results highlight the model's differential performance across stock categories, underscoring the influence of microstructural properties on predictability rates.

Evaluating Forecast Practicability

Beyond traditional metrics like the Matthews Correlation Coefficient (MCC), the paper advances a novel, strategy-oriented approach to assess the practicability of forecasts. This method, immune to class imbalances and assumptions-free, calculates the probability of executing a correct transaction based on the model's predictions. This evaluation offers a more nuanced understanding of model utility, differentiating between academically acceptable and practically viable forecasts.

Findings and Implications

The analysis reveals a stark contrast in forecasting performance and practicability across stock categories, with large-tick stocks showing higher predictability and practicability rates. The findings also illuminate the critical role of microstructural properties and class distributions in shaping forecasting outcomes. Additionally, the paper calls attention to the limitations of conventional machine learning metrics in capturing the efficacy of forecasts for trading strategies.

Future Directions

The paper concludes with recommendations for further research, including cross-exchange validations and explorations of different deep learning architectures. The potential of transformer models, diffusion models, and graph-based models in LOB forecasting is particularly highlighted, suggesting avenues for leveraging architectural nuances to address challenges inherent in modeling LOB dynamics.

Summary

This research contributes significantly to the field of high-frequency trading and market microstructure, offering both theoretical insights and practical tools for LOB forecasting. By bridging microstructural analysis with advanced machine learning techniques, the paper provides a foundation for developing more effective and practicable forecasting models, facilitating informed decision-making in financial markets.