Inspiration
We were inspired by historical events such as the Reddit Gamestop Stock skyrocket, and the above 1000% increase in cryptocurrencies like Dogecoin.
What it does
Our application is a modern analysis tool utilizing historical pricing trends and sentiment analysis to make accurate predictions on the current and future state of the stock market. Using data from Yahoo Finance, our application takes that data and feeds it through a LSTM neural network that is able to use multiple sources of input to make a prediction on the closing price 2 weeks from the current day. Our testing revealed an average mean squared error loss of less than 6% consistently, showcasing the accuracy of these long term predictions (which includes the sharp shifts during the timespan of COVID)
How we built it
The ML model was trained for specific companies and their trends, using their historical pricing data as well as sentiment data from Twitter and Reddit to make a judgement on the magnitude and direction of the next stock movement. This data was web scraped and processed using sentiment analysis to feed into our neural network. Our neural network takes multiple indicators, opening price, price delta, and the sentiment analysis value from corresponding tweets or posts of influencers at the time. All of this information gets elegantly captured and converted into a final closing price prediction using a LSTM cell neural network with optimized hyperparameters through Keras Tuner. Of course, there were a plethora other methods that would’ve been easier to implement and just as accurate in the short term (1 day-3 days). However, our choice of the LSTM neural model was to allow us the capability of accurately predicting the trends of the stock market well into the future, upwards of 10-30 days of prediction.
Challenges we ran into
Our initial intention was to have the machine learning model feed the predicted points, past data points, and sentiment scores to a React Frontend through Flask hosted on Google Cloud. Although this implementation was perfectly functional locally, Google Cloud limitations, such as limited file size (prevented React node modules), lack of server resources, and nonstop errors forced us to pivot away from React to vanilla HTML and Javascript.
Eventually, we successfully found a method to host the application with Flask. Yet with this solution, a new problem arose. There was difficulty in making our graphs dynamic. The lack of a database rendered our original plan of retrieving data from CSV files every run unfeasible and the idea was dropped.
Due to the time constraints, we settled on moving the entire project to a command line desktop application. Although we weren’t able to amplify this project with some stunning UI and visuals, we were able to retain a majority of the actual functionality of the project. Hallstone markers such as the accuracy and the month of foresign the program could offer were efficiently ported to this new platform.
Accomplishments that we're proud of
Our implementation of the ML model was solid, accurate, and very robust. The web scraping code we used was also very efficient in grabbing a multitude of different statistics (tweet count, dates, related influencers, authors) quickly without much user input. Although we weren’t able to showcase directly some of the visuals we had planned, we are proud that the project was able to be functionally completed.
What we learned
This was our first time dealing with a real neural network model that aims to predict a non-linear correlation between equally time separated data. We learned a lot about the execution required to create and optimize such neural networks to allow for accurate predictions while still being general enough to extrapolate for other data sets. We also gained a lot of experience dealing with databases, learning a new program, Flask, as well as the limitations of Google Cloud for the general user.
What's next for Mr.Rich
Our next step for Rich would be to deliver upon the visuals that we worked on in a manner that would allow us to truly display the fountain of knowledge that we can show through our trained model. Acquiring a speedy database, as well as a strong backend support are some of the immediate steps we can take toward this goal.
Log in or sign up for Devpost to join the conversation.