Skip to content

Research of reference market dynamics in multi exchange agent-based interactive discrete event simulations.

License

Notifications You must be signed in to change notification settings

phelstab/research-reference-markets-dynamics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Researching Financial Market Dynamics through Algorithmic Trading Agents

80
80

Document information

Author

phelstab

Status

wip

Classification of Information

open source

Location

GitHub

Change History

Version

Date

Author

Change

1.01

27.07.2024

phelstab

cleanup in process

1.0

24.11.2022

phelstab

init

1. Introduction

Our research explores the use of Agent-based Interactive Discrete Event Simulations
(ABIDES) for the analysis of complex financial market scenarios and the identification of
potential anomalies. The goal is to experimentally simulate financial market issues instead
of observing them, for example, in controversial pilot programs on real reference markets.
Our work encompasses various market fees and a synthetic competition between two
exchanges, employing an inter-market spread arbitrage machine to enable price stability
between the exchanges. In other experiments various market scenarios were simulated,
and key metrics such as the impact on execution quality, generated turnaround, and market
share of exchanges were analyzed under different marketplace fee scenarios. This
approach allows the observation of anomalies related to spreads, execution speed, traded
volumes, liquidity, probability of order execution, and the impact on agents' decision-
making.

2. ABIDES

2.1. Installation

# STRONGLY RECOMMENDED:
# USE UNIX BASED SYSTEM (Linux, Mac)
# due problems with windows dt & pd binaries (see 2.4)
#
# Step 0: Install Python version 3.7.14 or higher
sudo apt install software-properties-common -y
sudo add-apt-repository ppa:deadsnakes/ppa #unofficial but trusted
apt-get install python3.7
sudo apt install python3-pip
alias python=python3.7
# check with python --version (should be 3.7.14 or higher)
# Step 1: Clone repository
git clone https://github.com/phelstab/bachelor.git

# Step 2: Switch to abides folder
cd bachelor
cd abides-jpmc-public

# Step 3: Select Python version and create Virtual Environment
# Python 3.7.14 >= recommended (check with python --version)
# Update pip and create venv with example name lambda
# (Used lambda as naming for the venv)
python -m venv lambda

# Step 4: Activate venv
# Activate venv on Linux
source lambda/bin/activate
# Activate venv on Windows
.\lambda\Scripts\activate
# Activate venv on mac
source lambda/bin/activate
# or through fishshell
. lambda/bin/activate.fish

# Step 5: Update pip and install libs
python -m pip install --upgrade pip
pip install -r requirements_main.txt

# Step 6: Additional installs (recommended)
pip install torch
pip install tensorboard
pip install ipykernel
# Set up kernel for jupyter notebook to use venv in jupyter notebook
python -m ipykernel install --user --name=lambda

# Step 7: Run and install in abides root folder
pip install -e .

# Step 8: Example test run
# 8.1 switch to 000_experiments folder
cd 000_experiments
# 8.2 run rmsc05_var.py (variable market fees single exchange experiment)
python rmsc05_var.py
# 8.3 open post analysis dashboard in your browser

Overview of different experiments in the 000_experiments folder:

python rmsc05.py #(base model no fees)

python rmsc05_fix.py #(fix market fees, single exchange)
python rmsc05_var.py #(varaible market fees, single exchange)
python rmsc05_mt.py #(maker taker market fees, single exchange)

2.2. Architecture

ABIDES
Figure 1. ABIDES with extended experiment structure overview

2.3. Known Bugs

Pandas timedelta 64bit is returning wrong values on windows.

  • Python Version 3.7.14 on both systems

  • Pandas Version 1.2.4 on both systems

  • Numpy Version 1.20.3 on both systems

  • Windows 11 vs WSL

3. Appendix

3.1. References

Title

DOI

Source

Explaining Agent-Based Financial Market Simulation

10.48550/ARXIV.1909.11650

https://arxiv.org/abs/1909.11650

Towards Realistic Market Simulations: a Generative Adversarial Networks Approach

10.48550/ARXIV.2110.13287

https://arxiv.org/abs/2110.13287

ABIDES: Towards High-Fidelity Market Simulation for AI Research

10.48550/ARXIV.1904.12066

https://arxiv.org/abs/1904.12066

Explaining Agent-Based Financial Market Simulation

10.1145/3490354.3494433

https://doi.org/10.1145\%2F3490354.3494433

How to Evaluate Trading Strategies: Single Agent Market Replay or Multiple Agent Interactive Simulation?

10.48550/ARXIV.1906.12010

https://arxiv.org/abs/1906.12010

3.2. Short Paper and Poster

3.2.1. Arbeitskreis Wirtschaftsinformatik 2024 (Landshut)

About

Research of reference market dynamics in multi exchange agent-based interactive discrete event simulations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published