-
Notifications
You must be signed in to change notification settings - Fork 32
Home
Welcome to the gym-continuousDoubleAuction wiki!
This is WIP.
A custom MARL (multi-agent reinforcement learning) environment where multiple agents trade against one another in a CDA (continuous double auction).
The environment doesn't use any external data. Data is generated by self play of the agents themselves through their interaction with the limit order book.
At each time step, the environment emits the top k rows of the aggregated order book as observations to the agents.
An example of using RLlib to pit 1 PPO (Proximal Policy Optimization) agent against 3 random agents using this CDA environment is available in:
CDA_env_disc_RLlib.py
To run:
cd gym-continuousDoubleAuction/gym_continuousDoubleAuction
python CDA_env_disc_RLlib.py
The figure below from Tensorboard shows the agents' performance:
PPO agent is using policy 0 while policies 1 to 3 are used by the random agents.
- Tensorflow
- OpenAI's Gym
- Ray & RLlib
The environment is installable via pip.
cd gym-continuousDoubleAuction
pip install -e .
- custom RLlib workflow to include custom RND + PPO policies.
- parametric or hybrid action space
- more documentation
The orderbook matching engine is adapted from https://github.com/dyn4mik3/OrderBook
This repository is only meant for research purposes & is never meant to be used in any form of trading. Past performance is no guarantee of future results. If you suffer losses from using this repository, you are the sole person responsible for the losses. The author will NOT be held responsible in any way.