The Viability of Machine Learning in the Stock Market
Open Access
- Author:
- Stevenson, Nolan
- Area of Honors:
- Computer Science (Behrend)
- Degree:
- Bachelor of Science
- Document Type:
- Thesis
- Thesis Supervisors:
- Jonathan Liaw, Thesis Supervisor
Wen-Li Wang, Thesis Honors Advisor - Keywords:
- Machine Learning
Neural Network
Stock Prediction
Paper Trading - Abstract:
- The purpose of this thesis is to explore the viability of machine learning in the stock market. The stock market is an inherently chaotic system, as complicated and intricate as it is vast. Human stockbrokers tend to perform sufficiently after years of training and education. Given the advancements made in machine learning in recent years, it seems reasonable to test a model in one of the most extreme environments possible. Proficiency in the stock market would demonstrate the endless possibilities of machine learning. While this thesis will not shake the field of economics to its core, it can be one that can be built and expanded upon in future studies. For this project, a sequential neural network has been constructed. It is trained on a stock’s price and numerous other technical analysis indicators like the Exponential Moving Average and the Stochastic Relative Strength Index. All of the data is divided based on its interval, leaving four intervals of data to use: one-minute, five-minute, fifteen-minute, and one-day intervals. There are four labels that this model can choose from when predicting. It will predict whether the price of a stock is a peak, uptrend, downtrend, or valley. Effectively, the model is predicting the best times to buy and sell a certain stock. The accuracy scores of this model’s predictions vary based on the time interval. From an average accuracy of around forty percent with a one-day time interval to an overfit high of one hundred percent with a five-minute or one-minute interval. Additionally, the model’s actual performance on the stock market was simulated using paper trading simulation on historical stock data. The model produced gains on sixty-two and a half percent of its paper trading simulations. Further studies can build upon this model’s foundation and attempt to increase its accuracy and gain potential.