Skip to content

🤖 Stock trader that uses Reinforcement Learning to maximize the profit on a set of stocks.

Notifications You must be signed in to change notification settings

alexisdpc/RL-Stock-Trader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reinforcement Learning Stock Trader

The RL trader aims to maximize the profit by doing a daily rebalancing of the portfolio.

  • The model trains on the first half of the stock prices and tests on the second half.
  • The model predicts what action to take: buy/sell/hold based on historical data.
  • An epsilon-greedy policy is used to allow for exploration.

Prediction Model:

  • Linear Regression using Gradient Descent with Momentum

Results

This is an example of how the trader acts on one of the stocks (JPM).
Green points is when the trader buys, while red points are when the trader sells.

buy_sell

We also compare the returns on the 5 years of test data with two other portfolios:

  • Portfolio with equally-weighted stocks: 92.73 %

  • Portfolio with Reinforcement Learning agent: 114.23 %

image

About

🤖 Stock trader that uses Reinforcement Learning to maximize the profit on a set of stocks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published