Reinforcement Trading

Reinforcement Trading

Overview

Reinforcement learning is one of the purest forms of computer learning. It models what actions to take in complex environments. Naturally, one direct application for reinforcement learning is stock trading.

The project’s goal was to create an environment to test various reinforcement learning algorithms on stock trading. Minute-to-minute stock information is translated into several different pricing indicators. These indicators included some moving averages, volume-based indicators, and risk indicators. The changes in the stock metrics are translated into a state representation of the stock at a given time. From this state representation, Q-Learning is used to determine the optimal action to take at each step, whether to buy, sell, or hold. The rewards for each position factor in the cost of taking a position. The algorithm showed some promise, being able to produce a net positive return over a multi-day period. There are currently some limitations to the setup to be improved in future iterations.

Technology

Q-Learning was used to automatically create a trading strategy based on changes to different indicators. The algorithm and testing environment were created entirely using python. Results are visualized in Plotly.