llSourcell / Q-Learning-for-Trading

327 stars 177 forks source link

Overview

This is the code for this video on Youtube by Siraj Raval on Q Learning for Trading as part of the Move 37 course at School of AI. Credits for this code go to ShuaiW.

Related post: Teach Machine to Trade

Dependencies

Python 2.7. To install all the libraries, run pip install -r requirements.txt

Table of content

How to run

To train a Deep Q agent, run python run.py --mode train. There are other parameters and I encourage you look at the run.py script. After training, a trained model as well as the portfolio value history at episode end would be saved to disk.

To test the model performance, run python run.py --mode test --weights <trained_model>, where <trained_model> points to the local model weights file. Test data portfolio value history at episode end would be saved to disk.