Stock Swing Predictor

The Stock Swing Predictor (SSP) is a tool that will predict stock price swings using 7 different machine learning models. Implemented as a part of my award winning Allegheny College Senior Thesis.



Source Code Link

View Project

Tool Website Link

Use the Tool


2020-21 Academic Year

About Project

The Stock Price Swing Predictor was implemented as a part of my Senior Thesis at Allegheny College. I completed about 60 pages in writing for the thesis and was honored by winning the ACM Allegheny Student Chapter Prize, awarded to the writer of the CS department's best senior thesis, as determined by department faculty. My tool ended up working extremely well and rendered useful results about which models were best for making stock price predictions. You can view a video explaining the tool and results of my thesis here.

This work investigates whether machine learning models can be successfully used to predict stock price swings. Stock price swings occur when a price moves up or down. Preliminary research showed that there were a number of different methods being used for stock prediction including sentiment analysis, neural networks, and query volume analysis. SVMs were also identified as a machine learning model that could potentially be accurate in predicting price swings. A tool was implemented that scraped historical stock price data and then trained seven different machine learning models including SVMs, linear-regression-based models, and a K-Neighbors Regressor (KNR). This tool was then extensively tested by Pytest. The aforementioned models were then used to make predictions on the next day's stock price, which are then displayed to the user interface and exported to a JSON file for future analysis.

With this, experimentation was completed to determine which models could best predict historical stock price data and the price swings of the next day. The results from these experiments showed that Support Vector Regressions (SVRs) and KNRs performed the best for historical stock price prediction (the prediction of days that have already occurred). Additionally, results showed that SVRs offered the most potential in predicting future stock price swings as the experiment results found them to be the most accurate. The accuracy results of models varied by the size of historical stock price data that was used to train them. For instance, the two most accurate models were the SVR-Poly model when trained with a year of data (78%) and the SVR-RBF model which was 73% accurate when trained with 3 months of data.