Abstract
Market style analysis is critical when designing a stock price prediction framework. Under different market styles, stocks may show quite different behaviors; thus, predictions will vary. Consequently, incorporating market styles into stock price predictions should help improve the prediction performance. In this paper, we investigate how to characterize market styles to improve stock prediction performance under varying market styles. First, stock time series data are divided into windows of different lengths. The windows are summarized and represented by technical indicators and news sentiment features. Second, hierarchical clustering is employed to cluster the windows and categorize their market styles; the window lengths and number of market styles are carefully tuned to achieve the best clustering results. Third, a distance measurement is proposed to distinguish among rotating patterns within the market styles to verify the usability of the market styles. Finally, a stock price prediction framework is constructed to predict future stock price trends based on data belonging to the same market styles. The experiments are conducted with five years of real Hong Kong Stock Exchange data that includes both stock prices and corresponding news. Two famous sentiment dictionaries (i.e., SenticNet 5 and the Loughran-McDonald financial sentiment dictionary 2018) are employed to analyze the news sentiments. Predictive models are compared both with and without incorporating market styles. The results demonstrate that the approach incorporating market styles outperforms the baseline, which does not incorporate market styles. There is a maximum 9 percent improvement in terms of accuracy and F1-score. Moreover, backtesting results show that incorporating market styles into trading signals earns trading strategies more profits on most stocks.
Similar content being viewed by others
References
Akita R, Yoshihara A, Matsubara T, Uehara K. Deep learning for stock prediction using numerical and textual information. In: 2016 IEEE/ACIS 15th International Conference on Computer and Information Science (ICIS). IEEE; 2016. p. 1-6.
Bollen J, Mao H, Zeng X. Twitter mood predicts the stock market. J Comput Sci. 2011;2(1):1–8.
Buitinck L, Louppe, G, Blondel M, Pedregosa F, Mueller A, Grisel O, Niculae V, Prettenhofer P, Gramfort A, Grobler J, Layton R, Vander Plas J, Joly A, Holt B, Varoquaux G, et al. API design for machine learning software: experiences from the scikit-learn project. In: ECML PKDD Workshop: Languages for Data Mining and Machine Learning. 2013. p. 108–122.
Cambria E. Affective computing and sentiment analysis. IEEE intelligent systems. 2016;31(2):102–7.
Cambria, E., Li, Y., Xing, F.Z., Poria, S., Kwok, K.: Senticnet 6: Ensemble application of symbolic and subsymbolic ai for sentiment analysis. In: Proceedings of the 29th ACM International Conference on Information & Knowledge Management. 2020. p. 105–114.
Cambria E, Livingstone A, Hussain A. The hourglass of emotions. In: Cognitive behavioural systems. Springer; 2012. p. 144–157.
Cambria E, Poria S, Gelbukh A, Thelwall M. Sentiment analysis is a big suitcase. IEEE Intell Syst . 2017;32(6):74–80.
Cambria E, Poria S, Hazarika D, Kwok K. SenticNet 5: Discovering Conceptual Primitives for Sentiment Analysis by Means of Context Embeddings. In: AAAI Conference on Artificial Intelligence (AAAI-18). 2018. p. 1795–1802.
Cambria E, Schuller B, Xia Y, Havasi C. New Avenues in Opinion Mining and Sentiment Analysis. IEEE Intell Syst . 2013;28(2):15–21.
Chen K, Zhou Y, Dai F. A lstm-based method for stock returns prediction: A case study of china stock market. In: 2015 IEEE international conference on big data (big data). IEEE; 2015. p. 2823–2824.
Deng, S., Mitsubuchi, T., Shioda, K., Shimada, T., Sakurai, A.: Combining technical analysis with sentiment analysis for stock price prediction. In: 2011 IEEE Ninth International Conference on Dependable, Autonomic and Secure Computing. IEEE; 2011. p. 800–807.
Ding X, Zhang Y, Liu T, Duan J. Deep learning for event-driven stock prediction. In: Twenty-fourth international joint conference on artificial intelligence. 2015. p. 2327–2333.
Domino K. The use of the Hurst exponent to predict changes in trends on the Warsaw Stock Exchange. Physica A. 2011;390(1):98–109.
Engelberg J, Mclean RD, Pontiff J. Anomalies and News. J Finance. 2018;73(5):1971–2001.
Eom C, Choi S, Oh G, Jung WS. Hurst exponent and prediction based on weak-form efficient market hypothesis of stock markets. Physica A. 2008;387(18):4630–6.
Hu Z, Liu W, Bian J, Liu X, Liu TY. Listening to chaotic whispers: A deep learning framework for news-oriented stock trend prediction. In: Proceedings of the eleventh ACM international conference on web search and data mining. 2018. p. 261–269.
Indro D, Jiang C, Hu M, Lee W. Mutual fund performance: A question of style. J Invest. 1998;7:46–53.
Levis M, Liodakis M. The profitability of style rotation strategies in the United Kingdom: Depends on temporal volatility of underlying return spread between styles. J Portf Manag. 1999;26(1):73–86.
Li X, Cao J, Pan Z. Market impact analysis via deep learned architectures. Neural Comput Appl . 2018;31(10):5989–6000.
Li X, Huang X, Deng X, Zhu S. Enhancing quantitative intra-day stock return prediction by integrating both market news and stock prices information. Neurocomputing. 2014;142:228–38.
Li X, Wu P, Wang W. Incorporating stock prices and news sentiments for stock market prediction: A case of hong kong. Information Processing & Management. 2020. p. 102212.
Li X, Xie H, Chen L, Wang J, Deng X. News impact on stock price return via sentiment analysis. Knowl -Based Syst . 2014;69:14–23.
Li X, Xie H, Song Y, Zhu S, Li Q, Wang FL. Does summarization help stock prediction? a news impact analysis. IEEE intelligent systems. 2015;30(3):26–34.
Loughran T, McDonald B. When is a liability not a liability? Textual analysis, dictionaries, and 10-Ks. J Finance. 2011;66(1):35–65.
Lucas A, Van Dijk R, Kloek T. Stock selection, style rotation, and risk. J Empir Finance. 2002;9(1):1–34.
Pedregosa F, Varoquaux G, Gramfort A, Michel V, Thirion B, Grisel O, Blondel M, Prettenhofer P, Weiss R, Dubourg V, Vanderplas J, Passos A, Cournapeau D, Brucher M, Perrot M, Duchesnay E. Scikit-learn: Machine learning in Python. J Mach Learn Res. 2011;12:2825–30.
Picasso A, Merello S, Ma Y, Oneto L, Cambria E. Technical analysis and sentiment embeddings for market trend prediction. Expert Syst Appl . 2019;135:60–70.
Shi L, Member S, Teng Z, Wang L, Zhang Y, Binder A. DeepClue : Visual Interpretation of Text-Based Deep Stock Prediction. IEEE Trans Knowl Data Eng . 2019;31(6):1094–108.
Sun J, Huang Q, Li X. Determination of temporal stock investment styles via biclustering trading patterns. Cogn Comput. 2019;11(6):799–808.
Susanto Y, Livingstone A, Ng BC, Cambria E. The hourglass model revisited. IEEE Intell Syst . 2020;35(5):96–102.
Tetlock PC. Giving Content to Investor Sentiment : The Role of Media in the Stock Market. J Finance LXI. 2007;I(3):1139–68.
Wang Y, Liu L, Gu R. Analysis of efficiency for Shenzhen stock market based on multifractal detrended fluctuation analysis. Int Rev Financial Anal. 2009;18(5):271–6.
Xing FZ, Cambria E, Welsch RE. Natural language based financial forecasting: a survey. Artif Intell Rev . 2018;50(1):49–73.
Xing FZ, Cambria E, Zhang Y. Sentiment-aware volatility forecasting. Knowl -Based Syst . 2019;176:68–76.
Xiong R, Nichols EP, Shen Y. Deep Learning Stock Volatility with Google Domestic Trends. 2015, p. 0-5. arXiv preprinthttps://arxiv.org/abs/1512.04916v3.
Zhang X, Tan Y. Deep stock ranker: A LSTM neural network model for stock selection. Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) 10943 LNCS(181). 2018. p. 614–623.
Zhuang XT, Huang XY, Sha YL. Research on the fractal structure in the Chinese stock market. Physica A. 2004;333(1–4):293–305.
Funding
This work was supported in part by the National Natural Science Foundation of China under Grant 61602149, and in part by the Fundamental Research Funds for the Central Universities under Grant B210202078.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflicts of Interest
All authors declare that they have no conflict of interest.
Ethical Approval
This article does not contain any studies with human participants or animals performed by any of the authors.
Informed Consent
Informed consent was obtained from all individual participants included in the study.
Rights and permissions
About this article
Cite this article
Li, X., Wu, P. Stock Price Prediction Incorporating Market Style Clustering. Cogn Comput 14, 149–166 (2022). https://doi.org/10.1007/s12559-021-09820-1
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s12559-021-09820-1