GithubHelp home page GithubHelp logo

s-razmi / deeplob Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 83 KB

DeepLOB Implementation on Bitcoin Perpetual Data

License: MIT License

Jupyter Notebook 100.00%
algorithmic-trading bitcoin deep-learning deeplob limit-order-book lob tensorflow

deeplob's Introduction

Implementing DeepLOB on BTC perpetual LOB data:

This project focuses on implementing the "DeepLOB: Deep Convolutional Neural Networks for Limit Order Books" paper by Zhang et al. on BTCUSDT Perpetual data. The model is trained on the one-second timeframe of LOB data, and the results are reviewed. A Temporal Convolutional Neural Network (TCN) is also designed and trained on the same data, and the results are compared with the original model. The code is implemented in TensorFlow using Python.

Data Description

The analysis was encompassed by a two-week span of Limit Order Book (LOB) samples, each taken at a 25-millisecond interval, incorporating 20 columns for both bid and ask prices. However, due to its huge size, the data had to be resampled to 1-second intervals. The Dataset is available on Kaggle.

Normalization

The same approach outlined in the original paper was followed for normalization purposes. Specifically, a sliding window with a length of one day was utilized to calculate the mean and standard deviation of past data. This enabled the current row to be scaled based on those values.

Labeling

An averaging method is employed to generate mid-price first levels of bid and ask. The labeling process is carried out using the first method stated in the paper. A threshold alpha value of 0.00001 is also utilized, with a horizon of 10.

Models

This project employed two models for training: the original model from the referenced paper and a novel model based on the Temporal Convolutional Neural Network (TCN) architecture. Both models underwent a training process of 10 epochs, with the same Dataset being utilized to ensure a fair comparison.

The original model from the paper was adopted as the starting point, providing a reliable baseline for the research. Additionally, a TCN-based model was designed to explore the potential of enhancing predictive capabilities in the task. TCNs have demonstrated promise in various time-series tasks due to their ability to efficiently model long-range dependencies in sequential data, making them a compelling choice for experimentation in this project.

Results

For objective evaluation, a separate out-of-sample dataset, not used during training, was employed to validate the generalization abilities of each model and prevent potential biases from the training data. The results obtained from testing both models on this out-of-sample data were compared using various performance metrics, including accuracy, precision, recall, and F1-score, providing a comprehensive understanding of the strengths and weaknesses of each approach.

deeplob's People

Contributors

s-razmi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

npokemon

deeplob's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.