This repository contains the code used to collect Limit Order Book data from Bitfinex, convert them into a Pandas dataframe, and use them to train and simulate Multivariate Hawkes Processes.
You need to have Conda or Miniconda installed on your system.
If you don’t have it yet, follow the official installation guide:
https://docs.conda.io/projects/conda/en/latest/user-guide/install/
You will create two conda environments — one for data collection and one for training/simulation.
Create the environment from environment_bitfinex_api.yml:
conda env create -f environment_bitfinex_api.ymlCreate the environment from environment_hawkes.yml :
conda env create -f environment_hawkes.ymlActivate the data environment and run the collection script. Then convert the raw data to a Pandas dataframe.
conda activate bitfinex_api
python collect_lob_data.py
python convert_lob_data.pyActivate the Hawkes environment and run the training script (greedy algorithm):
conda activate hawkes
python train_multivariate_hawkes_with_greedy_b_all_training_periods_bi.pyStill in the Hawkes environment, simulate events:
python predict_mid_price_events.py