This is an implementation of the portfolio management solution described in the following paper: A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem. The purpose of this project was educational & to make the code more flexible than the original implementation for further usages in different applications.
- Code tested with
Python 3.7.9
,pytorch 1.8.0
,cuda 11.1
&cudnn 8.0
onWindows 10
- Requirements are installed from the
Pipfile.lock
( all commands are run at thePipfile
folder level).
To install your dependencies run:
pipenv sync
To activate the environment:
pipenv shell
Finally install pytorch
( you should be in the pipenv environment while doing this step, pipenv
does not support --find links / -f
):
pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 torchaudio==0.8.0 -f https://download.pytorch.org/whl/torch_stable.html
python train.py
--config_file config/crypto.yaml
--storage_path
/path/to/data/logging
python backtest.py
--config_file config\crypto.yaml
--storage_path
/path/to/data/logging
- These are the results after running the following command:
python backtest.py
--config_file
config\crypto_test_2017.yaml
--storage_path
\path\to\aiie_crypto_storage
- After a six month period of trading the agent made a +40% profit. But we can see that the portfolio value was not stable at all. Therefore, there is place for a lot of improvement.