REinforcement LEarning for Algorithmic Trading is a python framework for learning medium frequency trading algorithms for MetaTrader 5 (other trading platforms are planned for the future).
DISCALIMER: The information provided herein is for educational and informational purposes only and should not be construed as financial advice. It is not a recommendation to trade or invest real money. Always exercise your own judgment and use common sense when making financial decisions.
To build a collaborative community where software engineers, data scientists, RL researchers, quants and finance and economic experts can share knowledge. This framework covers the end-to-end process including:
In progress:
git clone https://github.com/releat215/releat.git
cd releat
Instructions to build to container from the DockerFile or develop using VSCode's dev containers can be found in the development notes. Code is containerised to provide consistency (especially when setting up MT5 in linux), easy deployment and scalability. To build the container:
docker build -t releat -f ./infrastructure/releat/Dockerfile .
Alternatively, a pre-built container can be used:
docker run \
--net host \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(pwd):/workspaces/releat \
-e DISPLAY \
--gpus all \
-it \
--name releat \
releat215/releat:1.0
This is an example of how to train and deploy a simple agent that trade EURUSD. For more information and/or trouble shooting guides, see the section on getting started.
Notes:
agents/t00001
folder.If opening a new terminal, connect interactively to the running docker container:
docker exec -it releat /bin/bash
Starts services necessary to train, deploy and monitor the reinforcement learning trading agent:
IMPORTANT: If it is the first time starting up the docker container, or if it has been rebuilt, log in the your MT5 account manually and click the allow autotrading button. If not, steps 3+ will not work.
releat start
releat launch-mt5-api metaquotes general
Build the features defined by the feature_config.py
script and upload to Aerospike.
releat build-train-data t00001
RL model is defined in agent_model.py
and the training hyperparameters are defined in agent_config.py
, including the number of iterations to run the training. Checkpoints are saved locally, which can then used for deployment
releat train t00001
Using the artifacts generated by the training process, this generate signal process is deployed to continuously:
The frequency of the prediction is controlled by the configs set in agent_config.py
releat generate-signal t00001
The trader is agent version agnostic (for now) and is deployed to:
releat launch-trader
Actively looking for contributors and collaborators to make this project even better! Please:
1) Create an issue
2) Create a new branch to work on your feature or bug fix. Give it a descriptive name.
3) Include tests for your feature or bug fix
4) Create a pull request
Alternatively, if you want to take the project in a different direction, feel free to fork the project.
If you have any questions, please contact: