A custom OpenAI gym environment for simulating stock trades on historical price data.
Baselines requires python3 (>=3.5) with the development headers. You'll also need system packages CMake, OpenMPI and zlib. Those can be installed as follows
Installation of system packages on Mac requires Homebrew. With Homebrew installed, run the follwing:
brew install cmake openmpi
Install the Stable Baselines package
Using pip from pypi:
pip install stable-baselines
Please read the documentation for more details and alternatives (from source, using docker).
Install the mpl_finance package for plotting
Using pip from pypi:
pip install mpl_finance
To get historical stock price data from Alpha Vantage, run the following code:
python fetchdata.py
You can either render the result to a text file or visualize it
python main.py
Check the parameter of the render function for usage.
If you'd like to learn about creating custom OpenAI gym environments, check out the Medium article