LSTM-based Stock Price Prediction Model using News Sentiments

Authors

  • Yijin Yan
  • Xin Nie
  • Mingyang Wang
  • Yuxin Chen

DOI:

https://doi.org/10.56028/aemr.6.1.57.2023

Keywords:

News sentiment; long short-term memory (LSTM) model; Naive Bayes sentiment classifier.

Abstract

Forecasting stock prices has been a prominent research topic in finance for many years. With the rapid advancement of internet technologies, financial news has become a crucial source of information for investors, and sentiment analysis of news articles has shown considerable potential in predicting future stock price movements. In this study, we developed a model that combines a Naive Bayes sentiment classifier to convert news text into sentiment indicators, and an LSTM neural network model to predict stock price movements. We obtained data from Oriental Fortune‘s financial commentary bar, covering the period from 28 July to 23 December 2022, resulting in a total of 318,373 data points. Then, we selected 1400 news items and manually labeled them to train a Naive Bayes classifier to quantify the news sentiment of each trading day. Our feature variables include sentiment indicator, closing price, price movements,  ratio, and  ratio of SSE 50 constituents. Finally, we applied the Long and Short-Term Memory (LSTM) model to predict stock price movements and compare their performance with the ARIMA time series method. Our results demonstrate that the LSTM model outperforms the traditional ARIMA model in predicting stock price movements. Furthermore, we compared the LSTM model with and without sentiment indicators and found that the inclusion of sentiment indicators significantly improves forecasting its performance. Overall, our proposed model offers a promising approach to predicting stock movements and provides insights into the effectiveness of incorporating sentiment analysis in financial forecasting.

Downloads

Published

2023-06-08