Stock Market Prediction Using Twitter Sentiment Analysis
DOI:
https://doi.org/10.32628/CSEIT217475Keywords:
Sentiment Analysis, Stock market prediction, Machine Learning, TwitterAbstract
Stock market prediction is an important topic in ?nancial engineering especially since new techniques and approaches on this matter are gaining value constantly. In this project, we investigate the impact of sentiment expressed through Twitter tweets on stock price prediction. Twitter is the social media platform which provides a free platform for each individual to express their thoughts publicly. Specifically, we fetch the live twitter tweets of the particular company using the API. All the stop words, special characters are extracted from the dataset. The filtered data is used for sentiment analysis using Naïve bayes classifier. Thus, the tweets are classified into positive, negative and neutral tweets. To predict the stock price, the stock dataset is fetched from yahoo finance API. The stock data along with the tweets data are given as input to the machine learning model to obtain the result. XGBoost classifier is used as a model to predict the stock market price. The obtained prediction value is compared with the actual stock market value. The effectiveness of the proposed project on stock price prediction is demonstrated through experiments on several companies like Apple, Amazon, Microsoft using live twitter data and daily stock data. The goal of the project is to use historical stock data in conjunction with sentiment analysis of news headlines and Twitter posts, to predict the future price of a stock of interest. The headlines were obtained by scraping the website, FinViz, while tweets were taken using Tweepy. Both were analyzed using the Vader Sentiment Analyzer.
References
- R. Ahuja, H. Rastogi, A. Choudhuri and B. Garg, “Stock market forecast using sentiment analysis”, 2nd International Conference on Computing for Sustainable Global Development, pp. 1008-1010, 2015.
- a. Mittal and a. Goel. “Stock Prediction Using Twitter Sentiment Analysis.” Tomx.Inf. Elte.Hu, (June), 2012.
- Agarwal, Apoorv, et al. “Sentiment analysis of twitter data.” Proceedings of the Workshop on Languages in Social Media. Association for Computational Linguistics, 2011.
- W. Antweiler and M. Frank. Do US stock markets typically overreact to corporate news stories? Working Paper, (1998):1–22, 2006.
- Jabaseeli, A. Nisha, and E. Kirubakaran. “A Survey on Sentiment Analysis of (Product) Reviews.” International Journal of Computer Applications 47.11, 2012.
- Fazel Zarandi M.H, Rezaee B, Turksen I.B and Neshat E. “A Type-2 Fuzzy Model for Stock Market Analysis.”, 2007.
- International Journal of Computer Applications (0975-8887) Volume 121 – No.20, July 2015 Sentiment Analysis on Social Media and Online Review.
- L. A. Gallagher and M. P. Taylor, “Permanent and temporary components of stock prices: evidence from assessing macroeconomic shocks,” Southern Economic Journal, vol. 69, pp. 345-362, 2002.
- S. Urolagin, “Text mining of tweet for sentiment classification and association with stock prices,” Proceedings of 2017 International Conference on Computer and Applications, pp. 384-388, 2017.
- V. S. Pagolu, K. N. Reddy, G. Panda and B. Majhi, “Sentiment analysis of Twitter data for predicting stock market movements, “Proceedings of 2016 International Conference on Signal Processing, Communication, Power and Embedded System, pp. 1345-1350, 2016.
- B. Qian and K. Rasheed, “Stock market prediction with multiple classifiers,” Applied Intelligence, vol. 26, pp. 25-33, 2007.
Downloads
Published
Issue
Section
License
Copyright (c) IJSRCSEIT

This work is licensed under a Creative Commons Attribution 4.0 International License.