VADER SENTIMENT ANALYSIS ON TWITTER: PREDICTING PRICE TRENDS AND DAILY RETURNS IN INDIA’S STOCK MARKET

Keywords: Stock Trend Prediction, Sentiment Analysis, Text Mining, Stock Market, Indian Stock Market, Machine Learning, VADER Algorithm.

Abstract

The study explores the effectiveness of sentiment analysis in predicting stock price movements, specifically focusing on the Indian Stock Market. The study investigates the reliability of social media sentiment analysis in financial markets and its implications for investors and traders. The research utilizes a sample of Twitter data comprising tweets containing hashtags related to the State Bank of India (SBI), used as a representative sample of the broader Indian Stock Market, collected from January 2021 to February 2024. The Valence Aware Dictionary for Sentiment Reasoning (VADER) algorithm was employed to analyse the sentiment of the Twitter data. Machine learning methods, including Random Forest, XGBoost, and AdaBoost, were used to integrate sentiment scores with technical indicators for predicting stock price trends. The results reveal that using only sentiment analysis achieved an accuracy of around 60% in predicting stock price direction. However, this accuracy increased to 70% with the AdaBoost method, 79% with the XGBoost method, and 82% with the Random Forest method combined with technical indicators while increasing the F1 scores from 0.4 to 0.8 in all three methods. Integrating sentiment analysis with technical indicators enhances financial market predictions by combining real-time investor sentiment with empirical historical data, leading to more accurate and adaptive trading strategies. Sentiment score was found to have a strong positive correlation with positive daily returns compared to negative daily returns, indicating that higher positive sentiment is associated with increased returns. Although negative sentiment exhibits a statistically significant correlation with daily returns, it shows a weaker positive association.

 JEL Classification Codes: G14, G17, C55, D85.

References

Ashtiani, M. N., & Raahemi, B. (2023). News-based intelligent prediction of financial markets using text mining and machine learning: A systematic literature review. Expert Systems with Applications, 217, 119509. https://doi.org/10.1016/j.eswa.2023.119509

Batra, R., & Daudpota, S. M. (2018). Integrating StockTwits with sentiment analysis for better prediction of stock price movement. 2018 International Conference on Computing, Mathematics and Engineering Technologies (iCoMET), 1–5. https://doi.org/10.1109/ICOMET.2018.8346382

Bhardwaj, A., Narayan, Y., Vanraj, Pawan, & Dutta, M. (2015). Sentiment Analysis for Indian Stock Market Prediction Using Sensex and Nifty. Procedia Computer Science, 70, 85–91. https://doi.org/10.1016/j.procs.2015.10.043

Bouadjenek, M. R., Sanner, S., & Wu, G. (2023). A User-Centric Analysis of Social Media for Stock Market Prediction. ACM Transactions on the Web, 17(2), 1–22. https://doi.org/10.1145/3532856

Chang, J., Tu, W., Yu, C., & Qin, C. (2021). Assessing dynamic qualities of investor sentiments for stock recommendation. Information Processing & Management, 58(2), 102452. https://doi.org/10.1016/j.ipm.2020.102452

Chen, M., Guo, Z., Abbass, K., & Huang, W. (2022). Analysis of the impact of investor sentiment on stock price using the latent dirichlet allocation topic model. Frontiers in Environmental Science, 10, 1068398. https://doi.org/10.3389/fenvs.2022.1068398

Dahal, K. R., Pokhrel, N. R., Gaire, S., Mahatara, S., Joshi, R. P., Gupta, A., Banjade, H. R., & Joshi, J. (2023). A comparative study on effect of news sentiment on stock price prediction with deep learning architecture. PLOS ONE, 18(4), e0284695. https://doi.org/10.1371/journal.pone.0284695

De Arriba-Perez, F., Garcia-Mendez, S., Regueiro-Janeiro, J. A., & Gonzalez-Castano, F. J. (2020). Detection of Financial Opportunities in Micro-Blogging Data With a Stacked Classification System. IEEE Access, 8, 215679–215690. https://doi.org/10.1109/ACCESS.2020.3041084

Deng, S., Mitsubuchi, T., Shioda, K., Shimada, T., & Sakurai, A. (2011). Combining Technical Analysis with Sentiment Analysis for Stock Price Prediction. 2011 IEEE Ninth International Conference on Dependable, Autonomic and Secure Computing, 800–807. https://doi.org/10.1109/DASC.2011.138

Dong, S., Wang, J., Luo, H., Wang, H., & Wu, F.-X. (2021). A dynamic predictor selection algorithm for predicting stock market movement. Expert Systems with Applications, 186, 115836. https://doi.org/10.1016/j.eswa.2021.115836

Dutta, A., Pooja, G., Jain, N., Panda, R. R., & Nagwani, N. K. (2021). A Hybrid Deep Learning Approach for Stock Price Prediction. In A. Joshi, M. Khosravy, & N. Gupta (Eds.), Machine Learning for Predictive Analysis (Vol. 141, pp. 1–10). Springer Singapore. https://doi.org/10.1007/978-981-15-7106-0_1

Ekaputri, A. P., & Akbar, S. (2022). Financial News Sentiment Analysis using Modified VADER for Stock Price Prediction. 2022 9th International Conference on Advanced Informatics: Concepts, Theory and Applications (ICAICTA), 1–6. https://doi.org/10.1109/ICAICTA56449.2022.9932925

Feng, S., Wang, N., & Zychowicz, E. J. (2017). Sentiment and the Performance of Technical Indicators. The Journal of Portfolio Management, 43(3), 112–125. https://doi.org/10.3905/jpm.2017.43.3.112

Gu, C., & Kurov, A. (2020). Informational role of social media: Evidence from Twitter sentiment. Journal of Banking & Finance, 121, 105969. https://doi.org/10.1016/j.jbankfin.2020.105969

Gülmez, B. (2023). Stock price prediction with optimized deep LSTM network with artificial rabbits optimization algorithm. Expert Systems with Applications, 227, 120346. https://doi.org/10.1016/j.eswa.2023.120346

Hansen, K. B., & Borch, C. (2022). Alternative data and sentiment analysis: Prospecting non-standard data in machine learning-driven finance. Big Data & Society, 9(1), 205395172110707. https://doi.org/10.1177/20539517211070701

Ho, T.-T., & Huang, Y. (2021). Stock Price Movement Prediction Using Sentiment Analysis and CandleStick Chart Representation. Sensors, 21(23), 7957. https://doi.org/10.3390/s21237957

Hutto, C., & Gilbert, E. (2014). Vader: A parsimonious rule-based model for sentiment analysis of social media text. Proceedings of the International AAAI Conference on Web and Social Media, 8(1), 216–225. https://doi.org/10.1609/icwsm.v8i1.14550

Khan, W., Ghazanfar, M. A., Azam, M. A., Karami, A., Alyoubi, K. H., & Alfakeeh, A. S. (2022). Stock market prediction using machine learning classifiers and social media news. Journal of Ambient Intelligence and Humanized Computing, 13(7), 3433–3456. https://doi.org/10.1007/s12652-020-01839-w

Kilimci, Z. H., & Duvar, R. (2020). An Efficient Word Embedding and Deep Learning Based Model to Forecast the Direction of Stock Exchange Market Using Twitter and Financial News Sites: A Case of Istanbul Stock Exchange (BIST 100). IEEE Access, 8, 188186–188198. https://doi.org/10.1109/ACCESS.2020.3029860

Liu, J., Lin, H., Yang, L., Xu, B., & Wen, D. (2020). Multi-Element Hierarchical Attention Capsule Network for Stock Prediction. IEEE Access, 8, 143114–143123. https://doi.org/10.1109/ACCESS.2020.3014506

Liu, Z., Guo, Y., & Mahmud, J. (2021). When and Why a Model Fails? A Human-in-the-loop Error Detection Framework for Sentiment Analysis. Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Industry Papers, 170–177. https://doi.org/10.18653/v1/2021.naacl-industry.22

Mardjo, A., & Choksuchat, C. (2022). HyVADRF: Hybrid VADER–Random Forest and GWO for Bitcoin Tweet Sentiment Analysis. IEEE Access, 10, 101889–101897. https://doi.org/10.1109/ACCESS.2022.3209662

Mehta, P., Pandya, S., & Kotecha, K. (2021). Harvesting social media sentiment analysis to enhance stock market prediction using deep learning. PeerJ Computer Science, 7, e476. https://doi.org/10.7717/peerj-cs.476

Mei, X., Zhou, Y., Zhu, C., Wu, M., Li, M., & Pan, S. (2023). A disentangled linguistic graph model for explainable aspect-based sentiment analysis. Knowledge-Based Systems, 260, 110150. https://doi.org/10.1016/j.knosys.2022.110150

Nguyen, T. H., Shirai, K., & Velcin, J. (2015). Sentiment analysis on social media for stock movement prediction. Expert Systems with Applications, 42(24), 9603–9611. https://doi.org/10.1016/j.eswa.2015.07.052

Njølstad, P. C. S., Høysæter, L. S., Wei, W., & Gulla, J. A. (2014). Evaluating Feature Sets and Classifiers for Sentiment Analysis of Financial News. 2014 IEEE/WIC/ACM International Joint Conferences on Web Intelligence (WI) and Intelligent Agent Technologies (IAT), 2, 71–78. https://doi.org/10.1109/WI-IAT.2014.82

Pagolu, V. S., Reddy, K. N., Panda, G., & Majhi, B. (2016). Sentiment analysis of Twitter data for predicting stock market movements. 2016 International Conference on Signal Processing, Communication, Power and Embedded System (SCOPES), 1345–1350. https://doi.org/10.48550/arXiv.1610.09225

Polyzos, E., Rubbaniy, G., & Mazur, M. (2024). Efficient Market Hypothesis on the blockchain: A social‐media‐based index for cryptocurrency efficiency. Financial Review, 59(3), 807–829. https://doi.org/10.1111/fire.12387

Rao, J., Ramaraju, V., Smith, J., & Bansal, A. (2022). A Sentiment Analysis Based Stock Recommendation System. 2022 IEEE Fifth International Conference on Artificial Intelligence and Knowledge Engineering (AIKE), 82–89. https://doi.org/10.1109/AIKE55402.2022.00020

Rubi, M. A., Chowdhury, S., Rahman, A. A. A., Meero, A., Zayed, N. M., & Islam, K. M. A. (2022). Fitting multi-layer feed forward neural network and autoregressive integrated moving average for Dhaka Stock Exchange price predicting. Emerging Science Journal, 6(5), 1046-1061. https://doi.org/10.28991/ESJ-2022-06-05-09

Ray, P., Ganguli, B., & Chakrabarti, A. (2021). A Hybrid Approach of Bayesian Structural Time Series With LSTM to Identify the Influence of News Sentiment on Short-Term Forecasting of Stock Price. IEEE Transactions on Computational Social Systems, 8(5), 1153–1162. https://doi.org/10.1109/TCSS.2021.3073964

Sawhney, R., Agarwal, S., Wadhwa, A., & Shah, R. R. (2020). Deep Attentive Learning for Stock Movement Prediction From Social Media Text and Company Correlations. Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), 8415–8426. https://doi.org/10.18653/v1/2020.emnlp-main.676

Sharaf, M., Hemdan, E. E.-D., El-Sayed, A., & El-Bahnasawy, N. A. (2023). An efficient hybrid stock trend prediction system during COVID-19 pandemic based on stacked-LSTM and news sentiment analysis. Multimedia Tools and Applications, 82(16), 23945–23977. https://doi.org/10.1007/s11042-022-14216-w

Soni, J., & Mathur, K. (2023). Sentiment Analysis of News Headlines for Stock Market Prediction using VADER. 2023 3rd International Conference on Innovative Mechanisms for Industry Applications (ICIMIA), 1215–1222. https://doi.org/10.1109/ICIMIA60377.2023.10426095

Wang, G., Wang, T., Wang, B., Sambasivan, D., Zhang, Z., Zheng, H., & Zhao, B. Y. (2014). Crowds on wall street: Extracting value from social investing platforms. arXiv Preprint arXiv:1406.1137. https://doi.org/10.48550/arXiv.1406.1137

Wang, Z., Hu, Z., Li, F., Ho, S.-B., & Cambria, E. (2023). Learning-Based Stock Trending Prediction by Incorporating Technical Indicators and Social Media Sentiment. Cognitive Computation, 15(3), 1092–1102. https://doi.org/10.1007/s12559-023-10125-8

Zou, Y., & Herremans, D. (2023). PreBit—A multimodal model with Twitter FinBERT embeddings for extreme price movement prediction of Bitcoin. Expert Systems with Applications, 233, 120838. https://doi.org/10.1016/j.eswa.2023.120838
Published
2024-07-28
How to Cite
Baruah, A., & Changkakati, B. (2024). VADER SENTIMENT ANALYSIS ON TWITTER: PREDICTING PRICE TRENDS AND DAILY RETURNS IN INDIA’S STOCK MARKET. Bangladesh Journal of Multidisciplinary Scientific Research, 9(2), 45-54. https://doi.org/10.46281/bjmsr.v9i2.2226
Section
Research Paper/Theoretical Paper/Review Paper/Short Communication Paper