# Algorithmic trading backtest and optimization examples using order book imbalances. (bitcoin, cryptocurrency, bitmex)

##### Overview

Full examples of algorithmic trading for Bitcoin using order book imbalances computed with a deeper level inspired by some articles on the internet(reference link as follows).
This example covers from the backtest to the trading bot implementation based on different kinds of order book imbalance strategies for BitMEX and Binance(working).

This strategies show a better risk reward ratio even though the Buy-and-Hold has a higher cumulative return.

You can see all previous optimized parameters in the notebook and commit history.

## Data

### Vendors

##### Using Bayesian, KNN, Logistic Regression to classify spam and non-spam.

Make Sure the dataset file "spamData.mat" is in the folder spam\src Environment: Python --version = 3.7 Third Party: numpy, matplotlib, math, scipy

##### Using A * search algorithm and GBFS search algorithm to solve the Romanian problem

Romanian-problem-using-Astar-and-GBFS Using A * search algorithm and GBFS search algorithm to solve the Romanian problem Romanian problem: The agent i

##### Sorting Algorithm Visualiser using pygame

SortingVisualiser Sorting Algorithm Visualiser using pygame Features Visualisation of some traditional sorting algorithms like quicksort and bubblesor

##### ðŸ§¬ Training the car to do self-parking using a genetic algorithm

ðŸ§¬ Training the car to do self-parking using a genetic algorithm

##### A tictactoe where you never win, implemented using minimax algorithm

Unbeatable_TicTacToe A tictactoe where you never win, implemented using minimax algorithm Requirements Make sure you have the pygame module along with

##### Optimal skincare partition finder using graph theory

Pigment The problem of partitioning up a skincare regime into parts such that each part does not interfere with itself is equivalent to the minimal cl

##### Exact algorithm for computing two-sided statistical tolerance intervals under a normal distribution assumption using Python.

norm-tol-int Exact algorithm for computing two-sided statistical tolerance intervals under a normal distribution assumption using Python. Methods The

##### Sign data using symmetric-key algorithm encryption.

Sign data using symmetric-key algorithm encryption. Validate signed data and identify possible validation errors. Uses sha-(1, 224, 256, 385 and 512)/hmac for signature encryption. Custom hash algorithms are allowed. Useful shortcut functions for signing (and validating) dictionaries and URLs.

##### Algorithm for Cutting Stock Problem using Google OR-Tools. Link to the tool:

Cutting Stock Problem Cutting Stock Problem (CSP) deals with planning the cutting of items (rods / sheets) from given stock items (which are usually o

• #### Trading Fees in Backtest.

When trades are closed, is it through a market order or limit? If limit, is there some sort of stop-loss in place?

Thanks.

opened by chasemb 2
• #### data source

Hi,

I was just trying to replicate your scripts crypto-scratch whose make use of data from tardis. I was able to download the sample data from this data provider but it appears to be not enough data to perform the entire analysis (in-out of sample periods).

I was wondering which data you are reading with the following command (e.g. xbtusd-normalization-market-making-backtest-hedge.ipynb ) :

imbalace or trades? That you saved in a pickle object in the notebook : tardis-process.ipynb

Did you subscribe to tardis for additional data? what subscription plan would do the job (retrieving enough data to run your notebooks).

Any advice/recommendation is welcome. Thank you in advance. BTW nice job! Jean-Fabrice

opened by jeanfabrice94121 2
• #### Quote mid price calculation

Can you explain how you calculate the new_bid and new_ask? What I don't get is how you compute the quote_mid_price. Does A stands for the quoted position?

opened by sanxy449 1
###### Python based framework providing a simple and intuitive framework for algorithmic trading

Harvest is a Python based framework providing a simple and intuitive framework for algorithmic trading. Visit Harvest's website for details, tutorials

100 Jan 3, 2023
###### Gnat - GNAT is NOT Algorithmic Trading

GNAT GNAT is NOT Algorithmic Trading! GNAT is a financial tool with two goals in

2 Jan 9, 2022
###### Minimal examples of data structures and algorithms in Python

Pythonic Data Structures and Algorithms Minimal and clean example implementations of data structures and algorithms in Python 3. Contributing Thanks f

22k Jan 9, 2023
###### Slight modification to one of the Facebook Salina examples, to test the A2C algorithm on financial series.

Facebook Salina - Gym_AnyTrading Slight modification of Facebook Salina Reinforcement Learning - A2C GPU example for financial series. The gym FOREX d

5 Mar 14, 2022
###### A Python Package for Portfolio Optimization using the Critical Line Algorithm

A Python Package for Portfolio Optimization using the Critical Line Algorithm

19 Oct 11, 2022
###### RRT algorithm and its optimization

RRT-Algorithm-Visualisation This is a project that aims to develop upon the RRT

7 Mar 6, 2022
###### Nature-inspired algorithms are a very popular tool for solving optimization problems.

Nature-inspired algorithms are a very popular tool for solving optimization problems. Numerous variants of nature-inspired algorithms have been develo

215 Dec 28, 2022
###### Dynamic Programming-Join Optimization Algorithm

DP-JOA Join optimization is the process of optimizing the joining, or combining, of two or more tables in a database. Here is a simple join optimizati

3 Feb 3, 2022
###### zoofs is a Python library for performing feature selection using an variety of nature inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics based to Evolutionary. It's easy to use ,flexible and powerful tool to reduce your feature size.

zoofs is a Python library for performing feature selection using a variety of nature-inspired wrapper algorithms. The algorithms range from swarm-intelligence to physics-based to Evolutionary. It's easy to use , flexible and powerful tool to reduce your feature size.

168 Dec 30, 2022
###### FingerPy is a algorithm to measure, analyse and monitor heart-beat using only a video of the user's finger on a mobile cellphone camera.

FingerPy is a algorithm using python, scipy and fft to measure, analyse and monitor heart-beat using only a video of the user's finger on a m

37 Oct 21, 2022