Welcome to Francis Academic Press

Academic Journal of Computing & Information Science, 2022, 5(12); doi: 10.25236/AJCIS.2022.051215.

Research on stock prediction algorithm based on CNN and LSTM


Keren He1, Qian Jiang2

Corresponding Author:
Qian Jiang

1Information Center, Changzhou University, Changzhou, China

2School of Computer and Artificial Intelligence, Changzhou University, Changzhou, China


The traditional resolution to forecast stock trends accurately is based on time series models. However, traditional time series models simply cannot fit the irregular movements of the market due to their own limitations.This study combines the advantages of convolutional neural networks (CNN) and long short-term memory networks (LSTM) for improving the stock prediction accuracy, uses the convolution idea of CNN to construct feature extraction layer to extract features, and inputs the extracted features into LSTM, to study the temporal message of the features better. The model constructed in this study can capture local features and time series information of stock data.The performance indicators of the proposed model are shown to be outperformed by CNN and LSTM, and the method is effective in reducing forecasting errors.


Stock prediction; Convolutional neural networks; Long short-term memory networks; Feature extraction

Cite This Paper

Keren He, Qian Jiang. Research on stock prediction algorithm based on CNN and LSTM. Academic Journal of Computing & Information Science (2022), Vol. 5, Issue 12: 98-106. https://doi.org/10.25236/AJCIS.2022.051215.


[1] Zhang L, Aggarwal C, Qi G J. Stock Price Prediction via Discovering Multi-Frequency Trading Patterns[C]// Acm Sigkdd International Conference on Knowledge Discovery & Data Mining. ACM, 2017:2141-2149.

[2] Yan X, Guosheng Z. Application of kalman filter in the prediction of stock price[C]//5th International Symposium on Knowledge Acquisition and Modeling (KAM 2015). Atlantis Press, 2015: 197-198.

[3] Peter G, Zhang. Time series forecasting using a hybrid ARIMA and neural network model [J]. Neurocomputing, 2003.

[4] Parzen E. ARARMA models for time series analysis and forecasting [J]. Journal of Forecasting, 2010, 1.

[5] Keim D B, Stambaugh R F. Predicting returns in the stock and bond markets [J]. Journal of financial Economics, 1986, 17(2): 357-390.

[6] He K, Zhang X, Ren S, et al. Deep residual learning for image recognition[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2016: 770-778.

[7] Anandarajan P M. Classifying inventory using an artificial neural network approach [J]. Computers & Industrial Engineering, 2002.

[8] Nelson D, Pereira A, Oliveira R. Stock market's price movement prediction with LSTM neural networks[C]// 2017 International Joint Conference on Neural Networks (IJCNN). IEEE, 2017.

[9] Chen K, Zhou Y, Dai F. A LSTM-based method for stock returns prediction: A case study of China stock market[C]// IEEE International Conference on Big Data. IEEE, 2015:2823-2824.

[10] Simonyan K, Zisserman A. Very Deep Convolutional Networks for Large-Scale Image Recognition [J]. Computer Science, 2014. 

[11] Szegedy C, Liu W, Jia Y, et al. Going deeper with convolutions[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 2015: 1-9.

[12] Hoseinzade E, Haratizadeh S. CNNpred: CNN-based stock market prediction using a diverse set of variables [J]. Expert Systems with Applications, 2019, 129(SEP.):273-285.

[13] Di Persio L, Honchar O. Artificial neural networks architectures for stock price prediction: Comparisons and applications [J]. International journal of circuits, systems and signal processing, 2016, 10(2016): 403-413.

[14] Hu Z, Liu W, Bian J, et al. Listening to Chaotic Whispers: A Deep Learning Framework for News-oriented Stock Trend Prediction: ACM, 10.1145/3159652.3159690 [P]. 2018.

[15] Xu Y, Cohen S B. Stock movement prediction from tweets and historical prices[C]//Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). 2018: 1970-1979.

[16] Bordino I, Kourtellis N, Laptev N, et al. Stock trade volume prediction with yahoo finance user browsing behavior[C]//2014 IEEE 30th International Conference on Data Engineering. IEEE, 2014: 1168-1173.

[17] Vantuch T, Zelinka I. Evolutionary based ARIMA models for stock price forecasting[C]//ISCS 2014: Interdisciplinary Symposium on Complex Systems. Springer, Cham, 2015: 239-247.

[18] Zhang X, Shen F, Zhao J, et al. Time Series Forecasting Using GRU Neural Network with Multi-lag After Decomposition[C]// International Conference on Neural Information Processing. Springer, Cham, 2017.

[19] Selvin S, Vinayakumar R, Gopalakrishnan E A , et al. Stock price prediction using LSTM, RNN and CNN-sliding window model[C]// International Conference on Advances in Computing. IEEE, 2017. 

[20] Cheng C H, Chen T L, Wei L Y. A hybrid model based on rough sets theory and genetic algorithms for stock price forecasting [J]. Information Sciences, 2010, 180(9):1610-1629.

[21] Kim K J, Han I. Genetic algorithms approach to feature discretization in artificial neural networks for the prediction of stock price index [J]. Expert Systems with Applications, 2000, 19(2):125-132.