React based web-application for stock price forecasting with a novel stacking algorithm

Accurately predicting the stock market could help traders incur significant profits. However, intrinsic volatility in the stock market, coupled with its nonlinear and dynamic nature makes the task of stock price forecasting challenging. Predicting trends in stock market prices has thus been an area...

Full description

Saved in:
Bibliographic Details
Main Author: Mittal, Madhav
Other Authors: Ng Wee Keong
Format: Final Year Project
Language:English
Published: Nanyang Technological University 2022
Subjects:
Online Access:https://hdl.handle.net/10356/156510
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Nanyang Technological University
Language: English
Description
Summary:Accurately predicting the stock market could help traders incur significant profits. However, intrinsic volatility in the stock market, coupled with its nonlinear and dynamic nature makes the task of stock price forecasting challenging. Predicting trends in stock market prices has thus been an area of interest for researchers for many years. The recent technological advances have led to an increase in the computational power of computers as well as the amount of readily accessible data. This has allowed for the implementation of extremely complicated machine learning systems that solve large-scale complex problems at extremely fast speeds. A plethora of machine learning based stock forecasting models have since been introduced. Today, the majority of the research papers that attempt stock price forecasting utilize machine learning models. Gradient Boosting Machines (GBMs) are an example of one such machine learning algorithm that is widely used in the field of stock price forecasting. GBM’s have been around for more than twenty years, however, they have recently received a revival in popularity, in the form of modern Gradient-Boosted Decision Trees such as Extreme Gradient Boosting (XgBoost) [1] in 2014 and Light Gradient Boosting Machine (LightGBM) [2] in 2017. This paper aims to build an XgBoost model by finding the optimal data features and hyperparameters required for the task of stock price forecasting. It proposes a novel ensemble using model stacking, that utilizes XgBoost, Supported Vector Regressor and Linear Regressor as the base models, and Linear Regressor as the meta-learner. It is concluded that this ensemble outperforms all the other models tested in the paper. The models are evaluated using three error metrics –Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE) and Mean Absolute Error (MAE). The model performances are compared against a threshold performance of the “Last Value” algorithm. The “Last Value” algorithm is a naïve algorithm that assumes zero volatility in the data and thus sets all forecasts to be the value of the last observation. The data is collected through the Yahoo Finance API. Additionally, the paper discusses the ideation and design processes of an interactive cross-platform React based web-application. Finally, it integrates the web-application with the Stacked XgBoost model using Flask.