Exploring order book predictability in cryptocurrency markets in a deep learning perspective using JAX
This project explores predictability in cryptocurrency markets, focusing on Bitcoin, the most widely known and liquid cryptocurrency. We use a Convolutional Neural Network (CNN), implemented with FLAX and JAX. Our experiment shows clear sign of short/mid term predictability in a trading perspective.
The order book contains the bid and ask orders placed by all the market participants, this book convolve a lot of information on the current state of a given market. While this is difficult to use the order book and read it with the naked eye, a machine can efficiently read and extract crucial information from the order book. The objective of our analysis is to identify which books are leading to movements in the market.
The study referenced in [5] implies that the initial level provides the most valuable information. In line with this perspective, the data used is the BTCUSDT book ticker (the first level of the order book), publicly available for the first day of each month on Tardis.dev. The notebook will automatically fetch historical order book data for BTCUSDT for the past six months, process the data, and prepare it for training.
Recent developments in [1,2,3] show that a CNN can accurately learn from time series data, our model is also a CNN implemented with Flax and JAX. Hyperparameters are tuned using the framework Optuna and the model is trained on 10 epochs. We log the metrics of the evaluation of the unseen test dataset, achieving 86% accuracy.
The trading strategy is implemented based on the predictions, considering latency, slippage, and fees. The performance of the strategy is discussed and visualized, including wallet value over time and the Sharpe ratio, as in [4]. We present the results for difference confidence levels, and the impact of latency, slippage, and fees on the trading strategy is underlined.
This project provides good insights into the predictability of order book data in cryptocurrency markets using a deep learning approach. It demonstrates the implementation of a trading strategy based on the model's predictions and evaluates its performance under realistic trading conditions. The use of such a predictive system could easily be wrapped within a trading bot for automated use, if able of consistently producing reliable predictions.
- [1] DeepLOB: Deep convolutional neural networks for limit order books - Zhang Z, Zohren S, Roberts S.
- [2] Deep Order Flow Imbalance: Extracting Alpha at Multiple Horizons from the Limit Order Book - Kolm, Petter N. et al.
- [3] THE SHORT-TERM PREDICTABILITY OF RETURNS IN ORDER BOOK MARKETS: A DEEP LEARNING PERSPECTIVE - Lucchese L, S.Pankkanen M, E.D.Veraart A.
- [4] Order Flow Imbalance - A High-Frequency Trading Signal - Dean Markwick.
- [5] How informative is the Order Book Beyond the Best Levels? Machine Learning Perspective - Tran D, Kanniainen J, Iosifidis A.