This project is a modified version of the original Trading Gym, which is an open-source project for the development of reinforcement learning algorithms in the context of trading. It is currently composed of a single environment and implements a generic way of feeding this trading environment different type of price data.
Semi-Perfect Sine-Function Trading
-
Make sure you have Python 3
-
Then install trading-gym
pip install tgym
We strongly recommend using virtual environments. A very good guide can be found at https://python-guide-pt-br.readthedocs.io/pt_BR/latest/dev/virtualenvs.html.
-
Then install keras
pip install keras
By default, the backend will be set to Theano. You can also run it with Tensorflow by installing it with
pip install tensorflow. You then need to edit~/.keras/keras.jsonand make sure"backend": "tensorflow"is specified.
python examples/dqn_agent.pyStored in config/config.json
To plot properly with matlibplot, you should disable "interactive mode" by adding this in your python scripts (I've added it to examples/dqn_agent.py already)
plt.interactive(False)Our environments API is strongly inspired by OpenAI Gym. We aim to entirely base it upon OpenAI Gym architecture and propose Trading Gym as an additional OpenAI environment.