Deep reinforcement learning multi-agent algorithmic trading framework that learns to trade from experience and then evaluate with brand new data
- Miniconda or Anaconda
# make sure you have these installed
sudo apt-get install gcc g++ build-essential python-dev python3-dev htop
# create env
conda env create -f linux_env.yml
# activate it
conda activate ray-0.8.0
# instatiate the environment
T_1000 = CreateEnv(assets=['OMG','BTC','ETH'],
currency='USDT',
granularity='day',
datapoints=600)
# define the hyperparams to train
T_1000.train(timesteps=5e4,
checkpoint_freq=10,
lr_schedule=[
[
[0, 7e-5], # [timestep, lr]
[100, 7e-6],
],
[
[0, 6e-5],
[100, 6e-6],
]
],
algo='PPO')
Once you have a sattisfatory reward_mean benchmark you can see how it performs with never seen data
# same environment
T_1000 = CreateEnv(assets=['OMG','BTC','ETH'],
currency='USDT',
granularity='day',
datapoints=600)
# checkpoint are saved in /results
# it will automatically use a different time period from trainnig to backtest
T_1000.backtest(checkpoint_path='path/to/checkpoint_file/checkpoint-400')
- state of the art agents
- hyperparam grid search
- multi agent parallelization
- learning rate schedule
- result analysis
"It just needs to touch something to mimic it." - Sarah Connor, about the T-1000
Some nice tools to keep an eye while your agent train are (of course) tensorboard
, gpustat
and htop
# from the project home folder
$ tensorboard --logdir=results
# show how your gpu is going
$ gpustat -i
# show how your cpu and ram are going
$ htop
Edit the commision and initial balance values in /variables.json
- Bind the agent's output with an exchange place order API