Predicting stock market trends using machine learning algorithms via public sentiment and political situation analysis

Stock market trends can be affected by external factors such as public sentiment and political events. The goal of this research is to find whether or not public sentiment and political situation on a given day can affect stock market trends of individual companies or the overall market. For this purpose, the sentiment and situation features are used in a machine learning model to find the effect of public sentiment and political situation on the prediction accuracy of algorithms for 7 days in future. Besides, interdependencies among companies and stock markets are also studied. For the sake of experimentation, stock market historical data are downloaded from Yahoo! Finance and public sentiments are obtained from Twitter. Important political events data of Pakistan are crawled from Wikipedia. The raw text data are then pre-processed, and the sentiment and situation features are generated to create the final data sets. Ten machine learning algorithms are applied to the final data sets to predict the stock market future trend. The experimental results show that the sentiment feature improves the prediction accuracy of machine learning algorithms by 0–3%, and political situation feature improves the prediction accuracy of algorithms by about 20%. Furthermore, the sentiment attribute is most effective on day 7, while the political situation attribute is most effective on day 5. SMO algorithm is found to show the best performance, while ASC and Bagging show poor performance. The interdependency results indicate that stock markets in the same industry show a medium positive correlation with each other.

[1]  Arjun Sil,et al.  Application of artificial neural network (ANN) for estimating reliable service life of reinforced concrete (RC) structure bookkeeping factors responsible for deterioration mechanism , 2019, Soft Comput..

[2]  Ling Xu,et al.  Study on a Novel Fault Damage Degree Identification Method Using High-Order Differential Mathematical Morphology Gradient Spectrum Entropy , 2018, Entropy.

[3]  Muhammad Tahir Suleman,et al.  Stock Market Reaction to Good and Bad Political News , 2012 .

[4]  Phichhang Ou,et al.  Prediction of Stock Market Index Movement by Ten Data Mining Techniques , 2009 .

[5]  Wu Deng,et al.  A novel collaborative optimization algorithm in solving complex optimization problems , 2016, Soft Computing.

[6]  Mohamed M. Mostafa,et al.  Forecasting stock exchange movements using neural networks: Empirical evidence from Kuwait , 2010, Expert Syst. Appl..

[7]  Ebrahimi Atani Reza,et al.  Stock market forecasting using artificial neural networks , 2014 .

[8]  Meng Sun,et al.  A New Feature Extraction Method Based on EEMD and Multi-Scale Fuzzy Entropy for Motor Bearing , 2016, Entropy.

[9]  Yi-Ming Wei,et al.  The effect of investor psychology on the complexity of stock market: An analysis based on cellular automaton model , 2009, Comput. Ind. Eng..

[10]  Christopher Potts,et al.  Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank , 2013, EMNLP.

[11]  Pedro G. Coelho,et al.  Structural reliability analysis using Monte Carlo simulation and neural networks , 2008, Adv. Eng. Softw..

[12]  Ling Liu,et al.  The effect of news and public mood on stock movements , 2014, Inf. Sci..

[13]  T. Bollerslev,et al.  Generalized autoregressive conditional heteroskedasticity , 1986 .

[14]  Hosein Naderpour,et al.  An innovative approach for bond strength modeling in FRP strip-to-concrete joints using adaptive neuro–fuzzy inference system , 2019, Engineering with Computers.

[15]  Bo Li,et al.  Study on an improved adaptive PSO algorithm for solving multi-objective gate assignment , 2017, Applied Soft Computing.

[16]  Li Bing,et al.  Public Sentiment Analysis in Twitter Data for Prediction of a Company's Stock Price Movements , 2014, 2014 IEEE 11th International Conference on e-Business Engineering.

[17]  Dirk Neumann,et al.  Automated news reading: Stock price prediction based on financial news using context-capturing features , 2013, Decis. Support Syst..

[18]  Anika Rahman,et al.  Sentiment Analysis on Twitter Data , 2016 .

[19]  Hosein Naderpour,et al.  Shear Failure Capacity Prediction of Concrete Beam–Column Joints in Terms of ANFIS and GMDH , 2019, Practice Periodical on Structural Design and Construction.

[20]  Hsinchun Chen,et al.  Textual analysis of stock market prediction using breaking financial news: The AZFin text system , 2009, TOIS.

[21]  K. S. Adewole,et al.  Stock Trend Prediction Using Regression Analysis - A Data Mining Approach , 2011 .

[22]  Dar-Hsin Chen,et al.  The Impacts of Political Events on Foreign Institutional Investors and Stock Returns: Emerging Market Evidence from Taiwan , 2005 .

[23]  Patrick Paroubek,et al.  Twitter as a Corpus for Sentiment Analysis and Opinion Mining , 2010, LREC.

[24]  Heeyoung Lee,et al.  On the Importance of Text Analysis for Stock Price Prediction , 2014, LREC.

[25]  W. Revelle psych: Procedures for Personality and Psychological Research , 2017 .

[26]  Paulo Cortez,et al.  On the Predictability of Stock Market Behavior Using StockTwits Sentiment and Posting Volume , 2013, EPIA.

[27]  Ömer Kaan Baykan,et al.  Predicting direction of stock price index movement using artificial neural networks and support vector machines: The sample of the Istanbul Stock Exchange , 2011, Expert Syst. Appl..

[28]  Bindu Garg,et al.  Stock market forecast using sentiment analysis , 2015, 2015 2nd International Conference on Computing for Sustainable Global Development (INDIACom).

[29]  Jie Zhou,et al.  Stock Price Forecasting by Combining News Mining and Time Series Analysis , 2009, 2009 IEEE/WIC/ACM International Joint Conference on Web Intelligence and Intelligent Agent Technology.

[30]  Andreas Chouliaras Online Appendix: High Frequency News in the European Financial Crisis , 2017 .

[31]  Johan Bollen,et al.  Modeling Public Mood and Emotion: Twitter Sentiment and Socio-Economic Phenomena , 2009, ICWSM.

[32]  Andreas S. Chouliaras High Frequency Newswire Textual Sentiment: Evidence from international stock markets during the European Financial Crisis , 2017 .

[33]  Olivia Sheng,et al.  Investigating Predictive Power of Stock Micro Blog Sentiment in Forecasting Future Stock Price Directional Movement , 2011, ICIS.

[34]  Julien Velcin,et al.  Sentiment analysis on social media for stock movement prediction , 2015, Expert Syst. Appl..

[35]  Michael J. Pazzani,et al.  User Modeling for Adaptive News Access , 2000, User Modeling and User-Adapted Interaction.

[36]  Firoz Khan,et al.  Sentiment Analysis of Twitter Data , 2018, International Research Journal on Advanced Science Hub.

[37]  Marie-Claude Beaulieu,et al.  The impact of political risk on the volatility of stock returns: the case of Canada , 2005 .

[38]  Devendra Tayal,et al.  Comparative Analysis of the Impact of Blogging and Micro-blogging on Market Performance , 2009 .

[39]  Rui Yao,et al.  A novel intelligent diagnosis method using optimal LS-SVM with improved PSO algorithm , 2017, Soft Computing.

[40]  Wu Deng,et al.  An Improved Ant Colony Optimization Algorithm Based on Hybrid Strategies for Scheduling Problem , 2019, IEEE Access.

[41]  Ke Xu,et al.  Can Online Emotions Predict the Stock Market in China? , 2016, WISE.

[42]  Shahwali Khan,et al.  Impact of Political and Catastrophic Events on Stock Returns , 2013 .

[43]  Sameena Shah,et al.  Stock Prediction Using Event-Based Sentiment Analysis , 2013, 2013 IEEE/WIC/ACM International Joint Conferences on Web Intelligence (WI) and Intelligent Agent Technologies (IAT).

[44]  Jui-Sheng Chou,et al.  Predicting Disputes in Public-Private Partnership Projects: Classification and Ensemble Models , 2013, J. Comput. Civ. Eng..

[45]  Farookh Khadeer Hussain,et al.  Support vector regression with chaos-based firefly algorithm for stock market price forecasting , 2013, Appl. Soft Comput..

[46]  J. Murphy Technical Analysis of the Futures Markets: A Comprehensive Guide to Trading Methods and Applications , 1986 .

[47]  Ron Kohavi,et al.  A Study of Cross-Validation and Bootstrap for Accuracy Estimation and Model Selection , 1995, IJCAI.

[48]  Sumitra Sadhukhan,et al.  Stock Market Prediction Using Artificial Neural Networks , 2016 .

[49]  Omar S. Soliman,et al.  A Machine Learning Model for Stock Market Prediction , 2014, ArXiv.

[50]  Li Chen,et al.  News impact on stock price return via sentiment analysis , 2014, Knowl. Based Syst..

[51]  Shahid Hussain,et al.  Impact of Political Event on Trading volume and Stock Returns: The Case of KSE , 2009 .

[52]  Manolis Papadrakakis,et al.  Reliability-based structural optimization using neural networks and Monte Carlo simulation , 2002 .