Inspiration

The subreddit /r/wallstreetbets is a subreddit focused on making dumb plays on high risk stocks. We decided to see how much money one could truly lose by following the advice of /r/wallstreetbets.

What it does

We created a machine learning model based on past performance of stocks picked out by /r/wallstreetbets to predict performance of future stocks by analyzing all the text from the title, post, and comments for each submission on /r/wallstreetbets that references a known stock symbol. Then, given the text of a new submission, we can predict how the stock will perform on the next day, and we make trades accordingly. Once every 24 hours, we gather all the posts from the last 24 hours and make trades based on mentioned stocks. Posts that have higher scores get weighted more heavily, and more of our portfolio is invested into the stocks that popular posts mention.

How we built it

We used python to access reddit's API to create a model of past data by gathering the title, post, and comments for each submission with a stock mentioned, and finding out whether the stock rose or dropped in value the following day using a stock tracking API, alphavantage. We gathered data from the past month to train our machine learning model using a Naive Bayes classifier. We then used Azure Functions so that we could easily call our prediction functions and figure out what to buy next, as well as to execute the actual trades using an Investopedia paper trading API in python. We set-up a function on stdlib that gets called once a day to prompt a reallocation of our portfolio according to our predictions. We created a simple website to track the progress of our /r/wallstreetbets-based portfolio on Investopedia.

UNLUCKY

Unfortunately, the stock market is not open on Sunday so we are unable to make live trades. We can however, show how we gather data and make predictions on how well a stock will do.

Built With

Share this project:

Updates