journal article·2024-09-27Open access

A Stock Prediction Method Based on Deep Reinforcement Learning and Sentiment Analysis

Sha Du, Hailong Shen

Applied Sciences· Volume 14· Issue 19

Abstract

Most previous stock investing methods were unable to predict newly listed stocks because they did not have historical data on newly listed stocks. In this paper, we use the Q-learning algorithm based on a convolutional neural network and add sentiment analysis to establish a prediction method for Chinese stock investment tasks. There are 118 companies that are ranked in the Chinese top 150 list for two consecutive years in both 2022 and 2023. We collected all comments under the stock bar of these 118 stocks for each day from 1 January 2022 to 1 July 2024, totaling nearly 10 million comments. There are 90 stocks left after the preprocessing of 118 stocks. We use these 90 stocks as the dataset. The stock’s closing price, volume, and comment text data are fed together to the agent, and the trained agent outputs investment behaviors that maximize future returns. We apply the trained model to two test sets that are completely different from the training set and compare it to several other methods. Our proposed method called SADQN-S obtains results of 1.1229 and 1.1054 on the two test sets. SADQN-S obtained higher final total assets than the other methods on both test sets. This shows that our model can help stock investors earn high returns on newly listed stocks.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Stock Market Forecasting Methods · Energy Load and Power Forecasting · Reinforcement Learning in Robotics

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

College of Science, Northeastern University, Shenyang 110819, China

References (55)

Show source-provided references
1. Comparison of arima and artificial neural networks models for stock price prediction10.1155/2014/614342 ↗
2. Yan, X., and Zhang, G. (2015). Application of kalman filter in the prediction of stock price. 5th International Symposium on Knowledge Acquisition and Modeling (KAM 2015), Atlantis Press.10.2991/kam-15.2015.53 ↗
3. Electric load forecasting by complete ensemble empirical mode decomposition adaptive noise and support vector regression with quantum-based dragonfly algorithm10.1007/s11071-019-05252-7 ↗
4. Application of variational mode decomposition and chaotic grey wolf optimizer with support vector regression for forecasting electric loads10.1016/j.knosys.2021.107297 ↗
5. Adnan, R.M., Dai, H.-L., Mostafa, R.R., Parmar, K.S., Heddam, S., and Kisi, O. (2022). Modeling multistep ahead dissolved oxygen concentration using improved support vector machines by a hybrid metaheuristic algorithm. Sustainability, 14.10.3390/su14063470 ↗
6. Human-level control through deep reinforcement learning10.1038/nature14236 ↗
7. Mastering the game of go with deep neural networks and tree search10.1038/nature16961 ↗
8. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play10.1126/science.aar6404 ↗
9. Learning hand-eye coordination for robotic grasping with deep learning and large-scale data collection10.1177/0278364917710318 ↗
10. Zhang, M., McCarthy, Z., Finn, C., Levine, S., and Abbeel, P. (2016, January 16–21). Learning deep neural network policies with continuous memory states. Proceedings of the 2016 IEEE International Conference on Robotics and Automation (ICRA), Stockholm, Sweden.10.1109/ICRA.2016.7487174 ↗
11. End-to-end training of deep visuomotor policies
12. Lenz, I., Knepper, R.A., and Saxena, A. (2015, January 13–17). DeepMPC: Learning deep latent features for model predictive control. Proceedings of the Robotics: Science and Systems, Rome, Italy.10.15607/RSS.2015.XI.012 ↗
13. Guo, H. (2015). Generating text with deep reinforcement learning. arXiv.
14. Li, J., Monroe, W., Ritter, A., Galley, M., Gao, J., and Jurafsky, D. (2016). Deep reinforcement learning for dialogue generation. arXiv.10.18653/v1/D16-1127 ↗
15. Narasimhan, K., Kulkarni, T., and Barzilay, R. (2015). Language understanding for text- based games using deep reinforcement learning. arXiv.10.18653/v1/D15-1001 ↗
16. Sallab, A.E., Abdou, M., Perot, E., and Yogamani, S. (2017). Deep reinforcement learning framework for autonomous driving. arXiv.10.2352/ISSN.2470-1173.2017.19.AVM-023 ↗
17. Caicedo, J.C., and Lazebnik, S. (2015, January 7–13). Active object localization with deep reinforcement learning. Proceedings of the 2015 IEEE International Conference on Computer Vision, Santiago, Chile.10.1109/ICCV.2015.286 ↗
18. Global stock market prediction based on stock chart images using deep Q-network10.1109/ACCESS.2019.2953542 ↗
19. Chen, L., and Gao, Q. (2019, January 18–20). Application of deep reinforcement learning on automated stock trading. Proceedings of the 2019 IEEE 10th International Conference on Software Engineering and Service Science (ICSESS), Beijing, China.10.1109/ICSESS47205.2019.9040728 ↗
20. Application of deep reinforcement learning in stock trading strategies and stock forecasting10.1007/s00607-019-00773-w ↗
21. A multi-layer and multi-ensemble stock trader using deep learning and deep reinforcement learning10.1007/s10489-020-01839-5 ↗
22. Dynamic stock-decision ensemble strategy based on deep reinforcement learning10.1007/s10489-022-03606-0 ↗
23. An integrated framework of deep learning and knowledge graph for prediction of stock price trend: An application in Chinese stock exchange market10.1016/j.asoc.2020.106205 ↗
24. Stock market prediction with deep learning: The case of China10.1016/j.frl.2021.102209 ↗
25. Cognitive style and political ideology10.1037/0022-3514.45.1.118 ↗
26. Kim, S.-M., and Hovy, E. (2004). Determining the sentiment of opinions. COLING 2004: Proceedings of the 20th International Conference on Computational Linguistics, COLING.10.3115/1220355.1220555 ↗
27. Investor sentiment and the cross-section of stock returns10.1111/j.1540-6261.2006.00885.x ↗
28. Rupande, L., Muguto, H.T., and Muzindutsi, P.-F. (2019). Investor sentiment and stock return volatility: Evidence from the johannesburg stock exchange. Cogent Econ. Financ., 7.10.1080/23322039.2019.1600233 ↗
29. Explainable stock prices prediction from financial news articles using sentiment analysis10.7717/peerj-cs.340 ↗
30. Zhu, E. (2024). BERTopic-Driven Stock Market Predictions: Unraveling Sentiment Insights. arXiv.
31. Deep Direct Reinforcement Learning for Financial Signal Representation and Trading10.1109/TNNLS.2016.2522401 ↗
32. Jiang, Z., Xu, D., and Liang, J. (2017). A Deep Reinforcement Learning Framework for the Financial Portfolio Management Problem. arXiv.
33. Shin, H.G., Ra, I., and Choi, Y.H. (2019, January 16–18). A Deep Multimodal Reinforcement Learning System Combined with CNN and LSTM for Stock Trading. Proceedings of the 2019 International Conference on Information and Communication Technology Convergence (ICTC), Jeju, Republic of Korea.10.1109/ICTC46691.2019.8939991 ↗
34. DeepTrader: A Deep Reinforcement Learning Approach for Risk-Return Balanced Portfolio Management with Market Conditions Embedding
35. Wang, J., Zhang, Y., Tang, K., Wu, J., and Xiong, Z. (2019, January 4–8). AlphaStock: A Buying-Winners-and-Selling-Losers Investment Strategy using Interpretable Deep Reinforcement Attention Networks. Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery Data Mining, Anchorage, AK, USA.10.1145/3292500.3330647 ↗
36. Millea, A. (2021). Deep Reinforcement Learning for Trading-A Critical Survey. Data, 6.10.20944/preprints202111.0044.v1 ↗
37. Pricope, T.V. (2021). Deep Reinforcement Learning in Quantitative Algorithmic Trading: A Review. arXiv.
38. Sutton, R.S., and Barto, A.G. (2018). Reinforcement Learning: An Introduction, MIT Press.
39. Wang, Z., Schaul, T., Hessel, M., Hasselt, H., Lanctot, M., and Freitas, N. (2016). Dueling network architectures for deep reinforcement learning. International Conference on Machine Learning, PMLR. Available online: https://proceedings.mlr.press/v48/wangf16.html.
40. Mnih, V., Badia, A.P., Mirza, M., Graves, A., Lillicrap, T., Harley, T., Silver, D., and Kavukcuoglu, K. (2016). Asynchronous methods for deep reinforcement learning. International Conference on Machine Learning, PMLR. Available online: https://proceedings.mlr.press/v48/mniha16.html.
41. Hessel, M., Modayil, J., Van Hasselt, H., Schaul, T., Ostrovski, G., Dabney, W., Horgan, D., Piot, B., Azar, M., and Silver, D. (2018). Rainbow: Combining improvements in deep reinforcement learning. Proc. AAAI Conf. Artif. Intell., 32.10.1609/aaai.v32i1.11796 ↗
42. Horgan, D., Quan, J., Budden, D., Barth-Maron, G., Hessel, M., Van Hasselt, H., and Silver, D. (2018). Distributed prioritized experience replay. arXiv.
43. Van Hasselt, H., Guez, A., and Silver, D. (2016). Deep reinforcement learning with double q-learning. Proc. AAAI Conf. Artif. Intell., 30.10.1609/aaai.v30i1.10295 ↗
44. Computational intelligence and financial markets: A survey and future directions10.1016/j.eswa.2016.02.006 ↗
45. Lim, B., Zohren, S., and Roberts, S. (2019). Enhancing time series momentum strategies using deep neural networks. arXiv.10.2139/ssrn.3369195 ↗
46. Machine learning in the Chinese stock market10.1016/j.jfineco.2021.08.017 ↗
47. Khan, S., and Alghulaiakh, H. (2020). ARIMA model for accurate time series stocks forecasting. Int. J. Adv. Comput. Sci. Appl., 11.10.14569/IJACSA.2020.0110765 ↗
48. Forecasting stock prices through univariate ARIMA modeling
49. Optimising the smoothness and accuracy of moving average for stock price data10.3846/20294913.2016.1216906 ↗
50. Forecasting Stock Prices through Exponential Smoothing Techniques in The Creative Industry of The UK Stock Market
51. Integrated system in forecasting stocks of goods using the exponential smoothing method10.35145/jabt.v2i1.57 ↗
52. Abraham, R., Samad, M.E., Bakhach, A.M., El-Chaarani, H., Sardouk, A., Nemar, S.E., and Jaber, D. (2022). Forecasting a stock trend using genetic algorithm and random forest. J. Risk Financ. Manag., 15.10.3390/jrfm15050188 ↗
53. Research on stock trend prediction method based on optimized random forest10.1049/cit2.12067 ↗
54. Stock intelligent investment strategy based on support vector machine parameter optimization algorithm10.1007/s00521-019-04566-2 ↗
55. A novel approach for stock price prediction using gradient boosting machine with feature engineering (gbm-wfe)10.24017/science.2020.1.3 ↗