Abstract

Every stock trader wants to successfully predict the price or trend of a stock in order to make a profit because stock price forecasts provide investors, traders, and financial professionals with signals about potential price movements, which can help them make more informed decisions about buying, selling, or holding stocks. This article selects the four largest stocks in the U.S. stock market by market capitalization: Google, Apple, Microsoft, and Amazon, and predicts their closing prices from 2013 to 2023. First, K-Nearest Neighbors (KNN) model is established for the closing price sequence after the first-order difference. Then a two-layer LSTM model is constructed to visualize the prediction results of the two models, and RMSE is calculated respectively. Comparing the prediction results of the two models, LSTM has a better prediction effect on the data set used in this paper. This paper finds that the LSTM model can capture the crucial time dependencies and relationships in financial time series data, which are essential for stock price prediction. Therefore, the LSTM model can often be used when predicting stocks in the future.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call