Skip to content

toma-x/exploring-order-book-predictability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

Exploring order book predictability in cryptocurrency markets in a deep learning perspective using JAX

Overview

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.

Business understanding

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.

Data dowload and processing

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.

Training the Model

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.

Evaluation and Trading Strategy

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.

Conclusion

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.

References