Inspiration
Our development team loves the mathematics behind machine learning algorithms. Looking into ways to apply our mathematical knowledge to real life, we became curious about the intersection of finance and technology. Delving deeper and deeper into this sector, we realized pursuing this topic has major potential in furthering our careers. We decided to use mathematical modeling and machine learning to predict future stock prices.
What it does
Our program takes user input of a stock ticker, a start date, and end date. Then, the program will collect data from the start to end date and train a LSTM neural network. Using this model, the prices of the next 30 days of the stock will be predicted and graphed on the user interface.
How we built it
We built it using python. Libraries used included
- tkinter (for the graphical user interface)
- matplotlib (for graphing forecasted data)
- numpy (for data management)
- yfinance (for fetching stock price data)
- keras (for training the LSTM neural network)
- sklearn (for preprocessing the data)
- datetime (for date management)
- threading and queue (to run computations separately from GUI)
Challenges we ran into
One major challenge we faced was the graphical user interface not responding. Our program would crash every time we tried to run it. After debugging, we realized the issue was that when running the computations, it would be resource heavy and take time. This resulted in the logic for refreshing the GUI being blocked and thus unresponsive. We solved this issue by separating the logic into separate threads to run on. One is used to manage the GUI, the other is used to run the background computations. This solved our issue of the user interface being unresponsive.
Accomplishments that we're proud of
We're proud to say that our code works and has a feasible accuracy. Although statistical analysis was not performed, a simple check was performed. Changing the end date to a previous point in time gives the user predicted prices. Since these predictions are for the past, just checking actual data from yahoo finance with the given graph showed to have consistency. Due to this accuracy, we are proud of this project.
What we learned
We learned that simple programs are harder than it looks. Solving one issue, leads to 10 other new issues that need to be solved. Sometimes it seemed for every step forward, we took two steps back. Eventually, we were able to catch up and complete the program.
What's next for Stock Market Predictor
From here, we just have to work on increasing our accuracy. We plan to do this by doing some feature engineering to include movement indicators such as RSI and rolling averages. We also plan on using multiple machine learning models to increase the accuracy.
Notes
- More Information is Provided on the Github README
Log in or sign up for Devpost to join the conversation.