Skip to main content
Log in

Stock Price Prediction Incorporating Market Style Clustering

  • Published:
Cognitive Computation Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

Notes

  1. https://github.com/mrjbq7/ta-lib

  2. https://finet.hk/

References

  1. 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.

  2. Bollen J, Mao H, Zeng X. Twitter mood predicts the stock market. J Comput Sci. 2011;2(1):1–8.

    Article  Google Scholar 

  3. 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.

  4. Cambria E. Affective computing and sentiment analysis. IEEE intelligent systems. 2016;31(2):102–7.

    Article  Google Scholar 

  5. 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.

  6. Cambria E, Livingstone A, Hussain A. The hourglass of emotions. In: Cognitive behavioural systems. Springer; 2012. p. 144–157.

  7. Cambria E, Poria S, Gelbukh A, Thelwall M. Sentiment analysis is a big suitcase. IEEE Intell Syst . 2017;32(6):74–80.

    Article  Google Scholar 

  8. 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.

  9. Cambria E, Schuller B, Xia Y, Havasi C. New Avenues in Opinion Mining and Sentiment Analysis. IEEE Intell Syst . 2013;28(2):15–21.

    Article  Google Scholar 

  10. 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.

  11. 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.

  12. 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.

  13. 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.

    Article  Google Scholar 

  14. Engelberg J, Mclean RD, Pontiff J. Anomalies and News. J Finance. 2018;73(5):1971–2001.

    Article  Google Scholar 

  15. 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.

    Article  Google Scholar 

  16. 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.

  17. Indro D, Jiang C, Hu M, Lee W. Mutual fund performance: A question of style. J Invest. 1998;7:46–53.

    Article  Google Scholar 

  18. 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.

    Article  Google Scholar 

  19. Li X, Cao J, Pan Z. Market impact analysis via deep learned architectures. Neural Comput Appl . 2018;31(10):5989–6000.

    Article  Google Scholar 

  20. 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.

    Article  Google Scholar 

  21. 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.

  22. 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.

    Article  Google Scholar 

  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.

    Article  Google Scholar 

  24. Loughran T, McDonald B. When is a liability not a liability? Textual analysis, dictionaries, and 10-Ks. J Finance. 2011;66(1):35–65.

    Article  Google Scholar 

  25. Lucas A, Van Dijk R, Kloek T. Stock selection, style rotation, and risk. J Empir Finance. 2002;9(1):1–34.

    Article  Google Scholar 

  26. 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.

    MathSciNet  MATH  Google Scholar 

  27. 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.

    Article  Google Scholar 

  28. 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.

    Article  Google Scholar 

  29. Sun J, Huang Q, Li X. Determination of temporal stock investment styles via biclustering trading patterns. Cogn Comput. 2019;11(6):799–808.

    Article  Google Scholar 

  30. Susanto Y, Livingstone A, Ng BC, Cambria E. The hourglass model revisited. IEEE Intell Syst . 2020;35(5):96–102.

    Article  Google Scholar 

  31. Tetlock PC. Giving Content to Investor Sentiment : The Role of Media in the Stock Market. J Finance LXI. 2007;I(3):1139–68.

    Article  Google Scholar 

  32. 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.

    Article  Google Scholar 

  33. Xing FZ, Cambria E, Welsch RE. Natural language based financial forecasting: a survey. Artif Intell Rev . 2018;50(1):49–73.

    Article  Google Scholar 

  34. Xing FZ, Cambria E, Zhang Y. Sentiment-aware volatility forecasting. Knowl -Based Syst . 2019;176:68–76.

    Article  Google Scholar 

  35. 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.

  36. 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.

  37. Zhuang XT, Huang XY, Sha YL. Research on the fractal structure in the Chinese stock market. Physica A. 2004;333(1–4):293–305.

    Article  MathSciNet  Google Scholar 

Download references

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

Authors

Corresponding author

Correspondence to Xiaodong Li.

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

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s12559-021-09820-1

Keywords

Navigation