Stock Price Movement Prediction Using Sentiment Analysis and CandleStick Chart Representation

Sensors (Basel). 2021 Nov 29;21(23):7957. doi: 10.3390/s21237957.

Abstract

Determining the price movement of stocks is a challenging problem to solve because of factors such as industry performance, economic variables, investor sentiment, company news, company performance, and social media sentiment. People can predict the price movement of stocks by applying machine learning algorithms on information contained in historical data, stock candlestick-chart data, and social-media data. However, it is hard to predict stock movement based on a single classifier. In this study, we proposed a multichannel collaborative network by incorporating candlestick-chart and social-media data for stock trend predictions. We first extracted the social media sentiment features using the Natural Language Toolkit and sentiment analysis data from Twitter. We then transformed the stock's historical time series data into a candlestick chart to elucidate patterns in the stock's movement. Finally, we integrated the stock's sentiment features and its candlestick chart to predict the stock price movement over 4-, 6-, 8-, and 10-day time periods. Our collaborative network consisted of two branches: the first branch contained a one-dimensional convolutional neural network (CNN) performing sentiment classification. The second branch included a two-dimensional (2D) CNN performing image classifications based on 2D candlestick chart data. We evaluated our model for five high-demand stocks (Apple, Tesla, IBM, Amazon, and Google) and determined that our collaborative network achieved promising results and compared favorably against single-network models using either sentiment data or candlestick charts alone. The proposed method obtained the most favorable performance with 75.38% accuracy for Apple stock. We also found that the stock price prediction achieved more favorable performance over longer periods of time compared with shorter periods of time.

Keywords: candlestick chart; convolution neural network; sentiment analysis; stock market.

MeSH terms

  • Algorithms
  • Humans
  • Investments*
  • Models, Economic
  • Neural Networks, Computer
  • Sentiment Analysis*