Research Article
MLStock: Multi-layer model for sentiment analysis based stock price prediction
Abstract
In this paper, we address the task of predicting stock prices using the market sentiments extracted from Twitter. We propose MLStock, a multi-layer framework that models the market sentiment with the stock layer, the sector layer, and the market layer using the Gated Recurrent Unit (GRU), and use the sentiment to make directional prediction on stock price. Existing methods consider stocks individually, and might miss the signals in the current market sector which will affect the stock later. In contrast, our model summa-rizes the sector and market states through individual states and shows an improvement over traditional machine learning methods.
Keywords: stock market indicator; Twitter; gated recurrent unit; neural networks; sentiment analysis.
References
- D. Murthy, Twitter. Polity Press Cambridge, 2018.
- C. E. Yoshinaga and F. H. F. d. Castro Junior, “The relationship between market sentiment index and stock rates of return: a panel data analysis,” BAR - Brazilian Administration Review, vol. 9, no. 2, pp. 189–210, Jun. 2012.
- C. Zhang, “Defining, Modeling, and Measuring Investor Sentiment,” University of California, Berkeley, Department of Economics, p. 43, 2008.
- N. Barberis, A. Mukherjee, and B. Wang, “Prospect Theory and Stock Returns: An Empirical Test,” The Review of Financial Studies, vol. 29, no. 11, pp. 3068–3107, Nov. 2016.
- S. Ebert and P. Strack, “Until the Bitter End: On Prospect Theory in a Dynamic Context,” American Economic Review, vol. 105, no. 4, pp. 1618–1633, Apr. 2015.
- E. F. Fama, “Efficient capital markets: A review of theory and empirical work,” The journal of Finance, vol. 25, no. 2, pp. 383–417, 1970.
- Mittal and A. Goel, “Stock Prediction Using Twitter Sentiment Analysis,” p. 5.
- V. S. Pagolu, K. N. R. Challa, G. Panda, and B. Majhi, “Sentiment Analysis of Twitter Data for Predicting Stock Market Movements,” arXiv:1610.09225 [cs], Oct. 2016, arXiv: 1610.09225.
- J. Bollen, H. Mao, and X.-J. Zeng, “Twitter mood predicts the stock market,” Journal of Computational Science, vol. 2, no. 1, pp. 1–8, Mar. 2011, arXiv: 1010.3003.
- H. Chen, G. Noronha, and V. Singal, “The price response to s&p 500 index additions and deletions: Evidence of asymmetry and a new explanation,” The Journal of Finance, vol. 59, no. 4, pp. 1901–1930, 2004.
- M. Vijh, “S&p 500 trading strategies and stock betas,” The Review of Financial Studies, vol. 7, no. 1, pp. 215–251, 1994.
- P. Yu and X. Yan, “Stock price prediction based on deep neural networks,” Neural Computing and Applications, vol. 32, no. 6, pp. 1609– 1628, Mar. 2020.
- K. Cho, B. Van Merrienboer, D. Bahdanau, and Y. Bengio, “On the¨ properties of neural machine translation: Encoder-decoder approaches,” arXiv preprint arXiv:1409.1259, 2014.
- Yadollahi, A. G. Shahraki, and O. R. Zaiane, “Current State of Text Sentiment Analysis from Opinion to Emotion Mining,” ACM Computing Surveys, vol. 50, no. 2, pp. 1–33, Mar. 2018.
- Y. R. Tausczik and J. W. Pennebaker, “The Psychological Meaning of Words: LIWC and Computerized Text Analysis Methods,” Journal of Language and Social Psychology, vol. 29, no. 1, pp. 24–54, Mar. 2010. [16] S. Baccianella, A. Esuli, and F. Sebastiani, “SENTIWORDNET 3.0: An Enhanced Lexical Resource for Sentiment Analysis and Opinion Mining,” in Proceedings of the Seventh International Conference on Language Resources and Evaluation (LREC’10), 2010, p. 5.
- C. Hutto and E. Gilbert, “VADER: A Parsimonious Rule-Based Model for Sentiment Analysis of Social Media Text,” Proceedings of the International AAAI Conference on Web and Social Media, vol. 8, no. 1, pp. 216–225, May 2014, number: 1.
- T. Mikolov, K. Chen, G. Corrado, and J. Dean, “Efficient Estimation of Word Representations in Vector Space,” arXiv:1301.3781 [cs], Sep. 2013, arXiv: 1301.3781.
- J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova, “BERT: Pretraining of Deep Bidirectional Transformers for Language Understanding,” arXiv:1810.04805 [cs], May 2019, arXiv: 1810.04805.
- T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan, R. Child, A. Ramesh, D. M. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler, M. Litwin
- S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish, A. Radford, I. Sutskever, and D. Amodei, “Language Models are Few-Shot Learners,” arXiv:2005.14165 [cs], Jul. 2020, arXiv: 2005.14165.
- Z. Yang, Z. Dai, Y. Yang, J. Carbonell, R. Salakhutdinov, and Q. V. Le, “XLNet: Generalized Autoregressive Pretraining for Language Understanding,” arXiv:1906.08237 [cs], Jan. 2020, arXiv: 1906.08237.
- T. Loughran and B. Mcdonald, “When Is a Liability Not a Liability? Textual Analysis, Dictionaries, and 10-Ks,” The Journal of Finance, vol. 66, no. 1, pp. 35–65, Feb. 2011.
- M. Kraus and S. Feuerriegel, “Decision support from financial disclosures with deep neural networks and transfer learning,” Decision Support Systems, vol. 104, pp. 38–48, Dec. 2017, arXiv: 1710.03954.
- D. Araci, “FinBERT: Financial Sentiment Analysis with Pre-trained Language Models,” arXiv:1908.10063 [cs], Aug. 2019, arXiv: 1908.10063.
- Giachanou and F. Crestani, “Like It or Not: A Survey of Twitter Sentiment Analysis Methods,” ACM Computing Surveys, vol. 49, no. 2, pp. 28:1–28:41, Jun. 2016.
- Xindong Wu, Xingquan Zhu, Gong-Qing Wu, and Wei Ding, “Data mining with big data,” IEEE Transactions on Knowledge and Data Engineering, vol. 26, no. 1, pp. 97–107, Jan. 2014.
- T.-P. Liang, X. Li, C.-T. Yang, and M. Wang, “What in Consumer Reviews Affects the Sales of Mobile Apps: A Multifacet Sentiment Analysis Approach,” International Journal of Electronic Commerce, vol. 20, no. 2, pp. 236–260, Dec. 2015.
- D. Kim, D. Kim, E. Hwang, and H.-G. Choi, “A user opinion and metadata mining scheme for predicting box office performance of movies in the social network environment,” New Review of Hypermedia and Multimedia, vol. 19, no. 3-4, pp. 259–272, Dec. 2013. [Online]. Available: https://doi.org/10.1080/13614568.2013.835450
- E. Ferrara, O. Varol, C. Davis, F. Menczer, and A. Flammini, “The Rise of Social Bots,” Communications of the ACM, vol. 59, no. 7, pp. 96–104, Jun. 2016, arXiv: 1407.5225.
- T. H. Nguyen, K. Shirai, and J. Velcin, “Sentiment analysis on social media for stock movement prediction,” Expert Systems with Applications, vol. 42, no. 24, pp. 9603–9611, Dec. 2015.
- C. Lin and Y. He, “Joint sentiment/topic model for sentiment analysis,” in Proceedings of the 18th ACM conference on Information and knowledge management, ser. CIKM ’09. New York, NY, USA: Association for Computing Machinery, Nov. 2009, pp. 375–384.
- M. Makrehchi, S. Shah, and W. Liao, “Stock Prediction Using EventBased Sentiment Analysis,” in 2013 IEEE/WIC/ACM International Joint Conferences on Web Intelligence (WI) and Intelligent Agent Technologies (IAT), vol. 1, Nov. 2013, pp. 337–342.
- X. Li, H. Xie, L. Chen, J. Wang, and X. Deng, “News impact on stock price return via sentiment analysis,” Knowledge-Based Systems, vol. 69, pp. 14–23, Oct. 2014.
- S. Bharathi and A. Geetha, “Sentiment analysis for effective stock market prediction,” International Journal of Intelligent Engineering and Systems, vol. 10, no. 3, pp. 146–154, 2017.
- E. Khedr, N. Yaseen et al., “Predicting stock market behavior using data mining technique and news sentiment analysis,” International Journal of Intelligent Systems and Applications, vol. 9, no. 7, p. 22, 2017.
- [R. Gencay, “Non-linear prediction of security returns with moving average rules,” Journal of Forecasting, vol. 15, no. 3, pp. 165–174, 1996.
- S. M. Idrees, M. A. Alam, and P. Agarwal, “A prediction approach for stock market volatility based on time series data,” IEEE Access, vol. 7, pp. 17287–17298, 2019.
- S. D. Vashishtha, U. Singh, and R. Kumar, “Prediction of buy and sell signals using a moving average-tool of technical analysis,” International Journal of Marketing Financial Services & Management Research, 2013.
- J. Wang and J. Kim, “Predicting stock price trend using macd optimized by historical volatility,” Mathematical Problems in Engineering, vol. 2018, no. PT.17, pp. 9280590.1–9280590.12, 2018.
- L. Andrade, “Stock market index trading algorithm using discrete hidden markov models and technical analysis,” 2017.
- T. Sanboon, K. Keatruangkamala, and S. Jaiyen, “A deep learning model for predicting buy and sell recommendations in stock exchange of thailand using long short-term memory,” in 2019 IEEE 4th International Conference on Computer and Communication Systems (ICCCS), 2019.
- Y. Chen, W. Lin, and J. Z. Wang, “A dual-attention-based stock price trend prediction model with dual features,” IEEE Access, vol. PP, no. 99, pp. 1–1, 2019.
- G. Lai, W. C. Chang, Y. Yang, and H. Liu, “Modeling long- and shortterm temporal patterns with deep neural networks,” ACM, 2018.