Skip to main content

The Effect of Online Investor Sentiment on Stock Movements: An LSTM Approach

  • Chapter
  • First Online:
Computer and Information Science 2021—Summer (ICIS 2021)

Part of the book series: Studies in Computational Intelligence ((SCI,volume 985))

Included in the following conference series:

Abstract

Analyzing stock trends based on the sentiment of social media provides a novel direction for investors to analyze the stock market. Behavioral financial theory and social psychology indicate that irrational behaviors related to financial decisions could result in stock fluctuations. Taking representative 20 stocks on Shanghai Stock Exchange as an example, user generated contents from January 31, 2017 to January 31, 2019 are obtained from Sina and Fortune.com. TF-IDF and TextRank algorithms are applied to extract keywords, based on which 2000-word-level financial sentiment lexicon is generated. In addition, the LSTM model is built and 23,152 comments were analyzed based on the lexicon. Eventually, relationships between sentiment scores and the trend of stock fluctuation are explored by applying the correlation coefficient parameter and Apriori algorithm. Results show that LSTM has a great advantage in sentiment analysis, which presents a higher accuracy (99.87%) than the sentiment lexicon-based method (94.57%). Taking the delay impact of stockholders’ sentiments on the stock trend into account, this research discusses the correlation between current investor sentiments and stock markets in the next few days. The paper finds that current emotional tendency has a deeper influence on the stock trend at the third day afterwards. Thus, this study extends financial sentiment lexicons, explores applications of LSTM machine learning in financial fields, and discusses the influence of investor sentiments on the stock market based on social media platforms. Processes of Web crawling, keyword extraction, sentiment analysis, correlation analysis and result visualization are coded in Python programming language, code packages are contributed through the Github website.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 169.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Li, D., Wang, Y., Madden, A., Ding, Y., Tang, J., Sun, G.G., Zhang, N., Zhou, E.: Analyzing stock market trends using social media user moods and social influence. J. Assoc. Inf. Sci. Technol. 70(9), 1000–1013 (2019)

    Article  Google Scholar 

  2. Aggarwal, U., Saxena, A., Herald, S.: Artificial intelligence review in stock markets. Int. J. Res. Eng. Sci. Manag. 2(11), 92–95 (2019)

    Google Scholar 

  3. Vachhani, H., Obiadat, M.S., Thakkar, A., Shah, V., Sojitra, R., Bhatia, J., Tanwar, S. : Machine learning based stock market analysis: a short survey. In: International Conference on Innovative Data Communication Technologies and Application, pp. 12–26. Springer, Cham (2019)

    Google Scholar 

  4. Rossi, M., Gunardi, A.: Efficient market hypothesis and stock market anomalies: empirical evidence in four European countries. J. Appl. Bus. Res. (JABR) 34(1), 183–192 (2018)

    Article  Google Scholar 

  5. Kumar, H., Jawa, R.: Efficient market hypothesis and calendar effects: empirical evidences from the Indian stock markets. Bus. Analyst 37(2), 145–160 (2017)

    Google Scholar 

  6. Shah, D., Isah, H., Zulkernine, F.: Stock market analysis: a review and taxonomy of prediction techniques. Int. J. Finan. Stud. 7(2), 26 (2019)

    Article  Google Scholar 

  7. Dash, M.: Testing the random walk hypothesis in the Indian stock market using ARIMA modelling. J. Appl. Manag. Investments 8(2), 71–77 (2019)

    Google Scholar 

  8. Nasr, N., Farhadi Sartangi, M., Madahi, Z.: A fuzzy random walk technique to forecasting volatility of Iran stock exchange index. Adv. Math. Finan. Appl. 4(1), 15–30 (2019)

    Google Scholar 

  9. Shaik, M., Maheswaran, S.: Random walk in emerging Asian stock markets. Int. J. Econ. Finan. 9(1), 20–31 (2017)

    Article  Google Scholar 

  10. Liu, B., Zhang, L.: A survey of opinion mining and sentiment analysis. In: Mining Text Data, pp. 415–463. Springer, Berlin (2012)

    Google Scholar 

  11. Pang, B., Lee, L.: Opinion Mining and Sentiment Analysis (Foundations and Trends (R) in Information Retrieval). Now Publishers Inc. (2008)

    Google Scholar 

  12. Schumaker, R.P., Chen, H.: A quantitative stock prediction system based on financial news. Inf. Process. Manag. 45(5), 571–583 (2009)

    Article  Google Scholar 

  13. Schumaker, R.P., Chen, H.: Textual analysis of stock market prediction using breaking financial news: the AZFin text system. ACM Trans. Inf. Syst. (TOIS) 27(2), 12 (2009)

    Article  Google Scholar 

  14. Bollen, J., Mao, H., Zeng, X.: Twitter mood predicts the stock market. J. Comput. Sci. 2(1), 1–8 (2011)

    Google Scholar 

  15. Mittal, A., Goel, A.: Stock Prediction Using Twitter Sentiment Analysis. Standford University, CS229 (2012). Available online. http://cs229.stanford.edu/proj2011/GoelMittalStockMarketPredictionUsingTwitterSentimentAnalysis.pdf. Cited 23 June 2021

  16. Lee, H., Surdeanu, M., MacCartney, B., Jurafsky, D.: On the importance of text analysis for stock price prediction. In: The 9th International Conference on Language Resources and Evaluation. LREC 2014, pp. 26–31. Reykjavik, Iceland (2014)

    Google Scholar 

  17. Kalyanaraman, V., Kazi, S., Tondulkar, R., Oswal, S.: Sentiment analysis on news articles for stocks. In: The 2014 8th Asia Modelling Symposium (AMS), pp. 23–25. Taipei, Taiwan (2014)

    Google Scholar 

  18. Cakra, Y.E., Trisedya, B.D.: Stock price prediction using linear regression based on sentiment analysis. In: The 2015 International Conference on Advanced Computer Science and Information Systems (ICACSIS), pp. 10–11. Depok, Indonesia (2015)

    Google Scholar 

  19. Gao, Z., Feng, A., Song, X., Wu, X.: Target-dependent sentiment classification with BERT. IEEE Access 7(1), 154290–154299 (2019)

    Article  Google Scholar 

  20. Pagolu, V.S., Reddy, K.N., Panda, G., Majhi, B.: Sentiment analysis of Twitter data for predicting stock market movements. In: The 2016 International Conference on Signal Processing, Communication, Power and Embedded System (SCOPES), pp. 3–5. Paralakhemundi, India (2016)

    Google Scholar 

  21. Xu, Y., Cohen, S.B.: Stock movement prediction from tweets and historical prices. In: The 56th Annual Meeting of the Association for Computational Linguistics, pp. 15–20. Melbourne, Australia (2018)

    Google Scholar 

  22. Mohammed, M., Omar, N.: Question classification based on Bloom’s taxonomy cognitive domain using modified TF-IDF and word2vec. PloS One 15(3) (2020). https://doi.org/10.1371/journal.pone.0230442

  23. Kazemi, A., Pérez-Rosas, V., Mihalcea, R.: Biased: TextRank: Unsupervised Graph-Based Content Extraction (2020). arXiv preprint arXiv:2011.01026. Available online. https://arxiv.org/pdf/2011.01026.pdf. Cited 23 June 2021

  24. Ombabi, A.H., Ouarda, W., Alimi, A.M.: Deep learning CNN-LSTM framework for Arabic sentiment analysis using textual information shared in social networks. Soc. Network Anal. Min. 10(1), 1–13 (2020)

    Article  Google Scholar 

  25. Beckman, M.D., Çetinkaya-Rundel, M., Horton, N.J., Rundel, C.W., Sullivan, A.J., Tackett, M.: Implementing version control with Git and GitHub as a learning objective in statistics and data science courses. J. Stat. Educ. 29(Sup 1), 1–35 (2020)

    Google Scholar 

  26. Bo, Y., Liu, Y., Li, H.: Sentiment classification in Chinese microblogs: lexicon-based and learning-based approaches. Int. Proc. Econ. Dev. Res. 68(1), 1–5 (2013)

    Google Scholar 

  27. Fulian, Y., Wang, Y., Liu, J., Lin, L.: The construction of sentiment lexicon based on context-dependent part-of-speech chunks for semantic disambiguation. IEEE Access 8(1), 63359–63367 (2020)

    Google Scholar 

Download references

Acknowledgements

This work is in part supported by the national key research project [YFE0101000], 2020 Key Technology R&D Program of GuangDong Province ZH01110405180056PWC] and Zhuhai Technology and Research Foundation [TC200802D4]. Thanks for the funding of mentioned projects.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Huawei Ma .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Wang, H. et al. (2021). The Effect of Online Investor Sentiment on Stock Movements: An LSTM Approach. In: Lee, R. (eds) Computer and Information Science 2021—Summer . ICIS 2021. Studies in Computational Intelligence, vol 985. Springer, Cham. https://doi.org/10.1007/978-3-030-79474-3_1

Download citation

Publish with us

Policies and ethics