Skip to content

MarkMH/hft_data_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project deals with market design approaches for eliminating undesirable arbitrage opportunities in the financial market. To this end, different designs are tested in an artificial financial market in the laboratory.

The data for this project will be generated through the economic experiments described in the following working paper: https://www.econtribute.de/RePEc/ajk/ajkdps/ECONtribute_172_2022.pdf. The data will be made available online, in accordance with the European Research Council's open access policy, once the experiments are completed. For the present project, data from preliminary pilot experiments were used.

The data generation process is designed such that each event in the market generates an observation. In this process, a microsecond-level timestamp is recorded for each observation. HFT_MT.py provides the data visualization and analysis, as well as the code snapshot below, which describes the pre-processing. First, any event prior to market starts is dropped, as events between trading periods are also captured while participants are viewing their preliminary results, for example. Second, the timestamps must be transformed such that calculations can be performed. Third, the time elapsed between entries for a given subject, called "timedelta", must be computed to observe, for example, how long a subject's order was in the market prior to execution.


The main code calls 2 functions found in python_wip. The first, create_pdf, takes a Python DataFrame as input and creates a corresponding PDF file. The PDF file is optimized for use in LaTeX for scientific writings. The inputs for this function are straightforward, note that MultiIndexLevel takes integers and helps if the column name is too large, i.e. it splits the column name across n lines.


The lineplot_prices function is optimized for plotting multiple price charts within one figure. Especially when the key, as well as the labels of the axes are identical. It is also designed to name the sub-graphs in ascending order.


Both functions are work in progress and are updated continuously, if you are interested in the current state of these functions, just contact me. I'm happy to share my code and always welcome comments.

About

Analysis of the data created during the high-frequency trading project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published