Predicting Stock Market Price Movement Using Sentiment Analysis: Evidence From Ghana

  • 1 Department of Computer Science and Informatics, University of Energy and Natural Resources, Sunyani, Ghana
  • 2 Department of Computer Science, Sunyani Technical University, Sunyani, Ghana

Abstract

Predicting the stock market remains a challenging task due to the numerous influencing factors such as investor sentiment, firm performance, economic factors and social media sentiments. However, the profitability and economic advantage associated with accurate prediction of stock price draw the interest of academicians, economic, and financial analyst into researching in this field. Despite the improvement in stock prediction accuracy, the literature argues that prediction accuracy can be further improved beyond its current measure by looking for newer information sources particularly on the Internet. Using web news, financial tweets posted on Twitter, Google trends and forum discussions, the current study examines the association between public sentiments and the predictability of future stock price movement using Artificial Neural Network (ANN). We experimented the proposed predictive framework with stock data obtained from the Ghana Stock Exchange (GSE) between January 2010 and September 2019, and predicted the future stock value for a time window of 1 day, 7 days, 30 days, 60 days, and 90 days. We observed an accuracy of (49.4–52.95 %) based on Google trends, (55.5–60.05 %) based on Twitter, (41.52–41.77 %) based on forum post, (50.43–55.81 %) based on web news and (70.66–77.12 %) based on a combined dataset. Thus, we recorded an increase in prediction accuracy as several stock-related data sources were combined as input to our prediction model. We also established a high level of direct association between stock market behaviour and social networking sites. Therefore, based on the study outcome, we advised that stock market investors could utilise the information from web financial news, tweet, forum discussion, and Google trends to effectively perceive the future stock price movement and design effective portfolio/investment plans.

If the inline PDF is not rendering correctly, you can download the PDF file here.

  • [1] A. E. Khedr, S. E. Salama, and N. Yaseen, “Predicting stock market behavior using data mining technique and news sentiment analysis,” International Journal of Intelligent Systems and Applications, vol. 9, no. 7, pp. 22–30, Jul. 2017. https://doi.org/10.5815/ijisa.2017.07.03

  • [2] R. Ren, D. D. Wu, and T. Liu, “Forecasting stock market movement direction using sentiment analysis and support vector machine,” IEEE Systems Journal, vol. 13, no. 1, pp. 760–770, Mar. 2019. https://doi.org/10.1109/JSYST.2018.2794462

  • [3] V. S. Pagolu, K. N. Reddy, G. Panda, and B. Majhi, “Sentiment analysis of Twitter data for predicting stock market movements,” in 2016 International Conference on Signal Processing, Communication, Power and Embedded System, 2017, pp. 1345–1350. https://doi.org/10.1109/SCOPES.2016.7955659

  • [4] F. Z. Xing, E. Cambria, and R. E. Welsch, “Intelligent asset allocation via market sentiment views,” IEEE Computational Intelligence Magazine, vol. 13, no. 4, pp. 25–34, Nov. 2018. https://doi.org/10.1109/MCI.2018.2866727

  • [5] I. K. Nti, A. F. Adekoya, and B. A. Weyori, “A systematic review of fundamental and technical analysis of stock market predictions,” Artificial Intelligence Review, vol. 53, no. 4, pp. 3007–3057, Apr. 2020. https://doi.org/10.1007/s10462-019-09754-z

  • [6] A. Picasso, S. Merello, Y. Ma, L. Oneto, and E. Cambria, “Technical analysis and sentiment embeddings for market trend prediction,” Expert Systems with Applications, vol. 135, pp. 60–70, 2019. https://doi.org/10.1016/j.eswa.2019.06.014

  • [7] W. Chen, Y. Cai, K. Lai, and H. Xie, “A topic-based sentiment analysis model to predict stock market price movement using Weibo mood,” Web Intelligence, vol. 14, no. 4, pp. 287–300, 2016. https://doi.org/10.3233/WEB-160345

  • [8] B. Li, K. C. C. Chan, C. Ou, and S. Ruifeng, “Discovering public sentiment in social media for predicting stock movement of publicly listed companies,” Information Systems, vol. 69, pp. 81–92, Sep. 2017. https://doi.org/10.1016/j.is.2016.10.001

  • [9] K. Guo, Y. Sun, and X. Qian, “Can investor sentiment be used to predict the stock price? Dynamic analysis based on China stock market,” Physica A: Statistical Mechanics and its Applications, vol. 469, pp. 390–396, 2017. https://doi.org/10.1016/j.physa.2016.11.114

  • [10] A. Pathak and N. P. Shetty, “Indian stock market prediction using machine learning and sentiment analysis,” in 4th International Conference on Computational Intelligence in Data Mining, 2019, pp. 595–603. https://doi.org/10.1007/978-981-10-8055-5_53

  • [11] S. N. Balaji, P. V. Paul, and R. Saravanan, “Survey on sentiment analysis based stock prediction using big data analytics,” in 2017 Innovations in Power and Advanced Computing Technologies, 2017, pp. 1–5. https://doi.org/10.1109/IPACT.2017.8244943

  • [12] N. Metawa, M. K. Hassan, S. Metawa, and M. F. Safa, “Impact of behavioral factors on investors’ financial decisions: case of the Egyptian stock market,” International Journal of Islamic and Middle Eastern Finance and Management, vol. 12, no. 1, pp. 30–55, 2019. https://doi.org/10.1108/IMEFM-12-2017-0333

  • [13] Y. Ruan, A. Durresi, and L. Alfantoukh, “Using Twitter trust network for stock market analysis,” Knowledge-Based Systems, vol. 145, pp. 207–218, 2018. https://doi.org/10.1016/j.knosys.2018.01.016

  • [14] T. T. P. Souza and T. Aste, “Predicting future stock market structure by combining social and financial network information,” Physica A: Statistical Mechanics and its Applications, vol. 535, 122343, 2019. https://doi.org/10.1016/j.physa.2019.122343

  • [15] D. M. E. D. M. Hussein, “A survey on sentiment analysis challenges,” Journal of King Saud University - Engineering Sciences, vol. 30, no. 4, pp. 330–338, Oct. 2018. https://doi.org/10.1016/j.jksues.2016.04.002

  • [16] A. Bhardwaj, Y. Narayan, Vanraj, Pawan, and M. Dutta, “Sentiment analysis for Indian stock market prediction using Sensex and Nifty,” in 4th International Conference on Eco-friendly Computing and Communication Systems, 2015, pp. 85–91. https://doi.org/10.1016/j.procs.2015.10.043

  • [17] G. Ranco, D. Aleksovski, G. Caldarelli, M. Grčar, and I. Mozetič, “The effects of Twitter sentiment on stock price returns,” PLoS ONE, vol. 10, no. 9, e0138441, 2015. https://doi.org/10.1371/journal.pone.0138441

  • [18] N. Apergis and I. Pragidis, “Stock price reactions to wire news from the European Central Bank: Evidence from changes in the sentiment tone and international market indexes,” Inter. Adv. in Economic Research, vol. 25, no. 1, pp. 91–112, 2019. https://doi.org/10.1007/s11294-019-09721-y

  • [19] S. Poria, E. Cambria, and A. Gelbukh, “Aspect extraction for opinion mining with a deep convolutional neural network,” Knowledge-Based Systems, vol. 108, pp. 42–49, 2016. https://doi.org/10.1016/j.knosys.2016.06.009

  • [20] M. V. Mäntylä, D. Graziotin, and M. Kuutila, “The evolution of sentiment analysis—A review of research topics, venues, and top cited papers,” Computer Science Review, vol. 27, pp. 16–32, 2018. https://doi.org/10.1016/j.cosrev.2017.10.002

  • [21] S. Merello, A. P. Ratto, L. Oneto, and E. Cambria, “Predicting Future Market Trends: Which Is the Optimal Window?” in INNS Big Data and Deep Learning Conference, 2020. https://doi.org/10.1007/978-3-030-16841-4_19

  • [22] R. Talib, K. M. Hanif, S. Ayesha, and F. Fatima, “Text mining: Techniques, applications and issues,” International Journal of Advanced Computer Science and Applications, vol. 7, no. 11, pp. 414–418, 2016. https://doi.org/10.14569/IJACSA.2016.071153

  • [23] Y. Wang, Q. Li, Z. Huang, and J. Li, “EAN: Event attention network for stock price trend prediction based on sentimental embedding,” in 10th ACM Conference on Web Science, 2019, pp. 311–320. https://doi.org/10.1145/3292522.3326014

  • [24] 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, 2015. https://doi.org/10.1016/j.eswa.2015.07.052

  • [25] S. Agarwal, S. Kumar, and U. Goel, “Stock market response to information diffusion through internet sources: A literature review,” International Journal of Information Management, vol. 45, pp. 118-131, Apr. 2019. https://doi.org/10.1016/j.ijinfomgt.2018.11.002

  • [26] T. Mitchell, Machine Learning, 1st Edition. McGraw Hill, 1997.

  • [27] N. Kim, K. Lučivjanská, P. Molnár, R. Villa, “Google searches and stock market activity: Evidence from Norway,” Finance Research Letters, vol. 28, pp. 208–220, Mar. 2019. https://doi.org/10.1016/j.frl.2018.05.003

  • [28] J. Ho and L. H. Kristiansen, “Can Google Trends predict gold returns and its implied volatility?” Master’s thesis, University of Stavanger, Norway, 2019.

  • [29] X. Zhong and M. Raghib, “Revisiting the use of web search data for stock market movements,” Scientific Reports, vol. 9, 13511, 2019. https://doi.org/10.1038/s41598-019-50131-1

  • [30] J. Fang, G. Gozgor, C.-K. M. Lau, and Z. Lu, “The impact of Baidu index sentiment on the volatility of China’s stock markets,” Finance Research Letters, vol. 32, 101099, Jan. 2020. https://doi.org/10.1016/j.frl.2019.01.011

  • [31] L. Bijl, G. Kringhaug, P. Molnar, and E. Sandvik, “Google searches and stock returns,” International Review of Financial Analysis, vol. 45, pp. 150–156, May 2016. https://doi.org/10.1016/j.irfa.2016.03.015

  • [32] R. Chiong, M. T. P. Adam, Z. Fan, B. Lutz, Z. Hu, and D. Neumann, “A sentiment analysis-based machine learning approach for financial market prediction via news disclosures,” in 2018 Genetic and Evolutionary Computation Conference Companion, 2018, pp. 278–279. https://doi.org/10.1145/3205651.3205682

  • [33] 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. https://doi.org/10.1016/j.dss.2017.10.001

  • [34] A. García-Medina, L. Sandoval, E. U. Bañuelos, and A. M. Martínez-Argüello, “Correlations and flow of information between The New York Times and stock markets,” Physica A: Statistical Mechanics and its Applications, vol. 502, pp. 403-415, 2018. https://doi.org/10.1016/j.physa.2018.02.154

  • [35] A. Alshahrani Hasan and A. C. Fong, “Sentiment analysis based fuzzy decision platform for the Saudi stock market,” in 2018 IEEE International Conference on Electro/Information Technology, 2018, pp. 23–29. https://doi.org/10.1109/EIT.2018.8500292

  • [36] A. E. O. Carosia, G. P. Coelho, and A. E. A. Silva, “Analyzing the Brazilian financial market through Portuguese sentiment analysis in social media,” Applied Artificial Intelligence, vol. 34, no. 1, pp. 1–19, 2019. https://doi.org/10.1080/08839514.2019.1673037

  • [37] K. M. Swamy, “Sentiment Analysis with Tensorflow – TensorFlow and Deep Learning Singapore,” 2017. [Online]. Available: https://engineers.sg/video/sentiment-analysis-with-tensorflowtensorflow-and-deep-learning-singapore--1742.

  • [38] J. Roesslein, “Tweepy Documentation.” [Online]. Available: http://docs.tweepy.org/en/latest/.

  • [39] R. Batra and S. M. Daudpota, “Integrating StockTwits with sentiment analysis for better prediction of stock price movement,” in 2018 International Conference on Computing, Mathematics and Engineering Technologies, 2018, pp. 1–5. https://doi.org/10.1109/ICOMET.2018.8346382

  • [40] S. Bird, E. Klein, and E. Loper, Natural Language Processing with Python. O’Reilly Media Inc., 2009.

  • [41] J. Hogue and B. DeWilde, “Pytrends.” [Online]. Available: https://pypi.org/project/pytrends/.

  • [42] B. Li and L. Han, “Distance weighted cosine similarity measure for text classification,” in 14th International Conference on Intelligent Data Engineering and Automated Learning, 2013, pp. 611–618. https://doi.org/10.1007/978-3-642-41278-3_74

  • [43] K. Ravi and V. Ravi, “A survey on opinion mining and sentiment analysis: Tasks, approaches and applications,” Knowledge-Based Systems, vol. 89, pp. 14–46, Nov. 2015. https://doi.org/10.1016/j.knosys.2015.06.015

  • [44] S. Agrawal, D. Thakkar, D. Soni, K. Bhimani, and C. Patel, “Stock market prediction using machine learning techniques,” International Journal of Scientific Research in Computer Science, Engineering and Information Technology, vol. 5, no. 2, pp. 1099–1103, Mar.–Apr. 2019. https://doi.org/10.32628/CSEIT1952296

  • [45] B. W. Wanjawa, “Predicting future Shanghai stock market price using ANN in the period 21-Sep-2016 to 11-Oct-2016,” 2016. [Online]. Available: https://arxiv.org/abs/1609.05394

  • [46] F. Z. Xing, E. Cambria, and R. E. Welsch, “Natural language based financial forecasting: a survey,” Artificial Intelligence Review, vol. 50, no. 1, pp. 49–73, 2018. https://doi.org/10.1007/s10462-017-9588-9

  • [47] S. Dey, Y. Kumar, S. Saha, and S. Basak, “Forecasting to classification: Predicting the direction of stock market price using xtreme gradient boosting,” 2016.

  • [48] H. Z. Khan, S. T. Alin, and A. Hussain, “Price prediction of share market using artificial neural network (ANN),” International Journal of Computer Applications, vol. 22, no. 2, pp. 42–47, May 2011. https://doi.org/10.5120/2552-3497

OPEN ACCESS

Journal + Issues

Search