Skip to main content
Log in

A CNN-BiLSTM-AM method for stock price prediction

  • Review
  • Published:
Neural Computing and Applications Aims and scope Submit manuscript

Abstract

In recent years, with the rapid development of the economy, more and more people begin to invest into the stock market. Accurately predicting the change of stock price can reduce the investment risk of stock investors and effectively improve the investment return. Due to the volatility characteristics of the stock market, stock price prediction is often a nonlinear time series prediction. Stock price is affected by many factors. It is difficult to predict through a simple model. Therefore, this paper proposes a CNN-BiLSTM-AM method to predict the stock closing price of the next day. This method is composed of convolutional neural networks (CNN), bi-directional long short-term Memory (BiLSTM), and attention mechanism (AM). CNN is used to extract the features of the input data. BiLSTM uses the extracted feature data to predict stock closing price of the next day. AM is used to capture the influence of feature states on the stock closing price at different times in the past to improve the prediction accuracy. In order to prove the effectiveness of this method, this method and other seven methods are used to predict the stock closing price of the next day for 1000 trading days of the Shanghai Composite Index. The results show that the performance of this method is the best, MAE and RMSE are the smallest (which are 21.952 and 31.694). R2 is the largest (its value is 0.9804). Compared with other methods, the CNN-BiLSTM-AM method is more suitable for the prediction of stock price and for providing a reliable way for investors’ to make stock investment decisions.

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.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14

Similar content being viewed by others

References

  1. Jin Z, Yang Y, Liu Y (2020) Stock closing price prediction based on sentiment analysis and LSTM. Neural Comput Appl. https://doi.org/10.1007/s00521-019-04504-2

    Article  Google Scholar 

  2. Badea L, Ionescu V, Guzun A (2019) What is the causal relationship between stoxx europe 600 sectors? but between large firms and small firms. Econ Comput Econ Cybern Stud Res 53(3):5–20

    Google Scholar 

  3. Algheriani NMS, Majstorovic VD, Kirin S, Spasojevic Brkic V (2019) Risk Model for Integrated Management System. Tehnicki vjesnik Tech Gaz 26(6):1833–1840

    Google Scholar 

  4. Liu Y, Hu Z, Li H, Zhu H (2019) Does preemption lead to more leveled resource usage in projects? a computational study based on mixed-integer linear programming. Econ Comput Econ Cybern Stud Res 53(4):243–258

    Google Scholar 

  5. Li J, Pan S, Huang L, Zhu X (2019) A machine learning based method for customer behavior prediction. Tehnicki vjesnik Tech Gaz 26(6):1670–1676

    Google Scholar 

  6. Moon K, Kim H (2019) Performance of deep learning in prediction of stock market volatility. Econ Comput Econ Cybern Stud Res 53(2):77–92

    Google Scholar 

  7. Kohara K, Fukuhara Y, Nakamur Y (1996) Selective presentation learning for neural network forecasting of stock markets. Neural Comput Appl. https://doi.org/10.1007/BF01414874

    Article  Google Scholar 

  8. Xiao C, Xia W, Jiang J (2020) Stock price forecast based on combined model of ARI-MA-LS-SVM. Neural Comput Appl. https://doi.org/10.1007/s00521-019-04698-5

    Article  Google Scholar 

  9. Yu P, Yan X (2020) Stock price prediction based on deep neural networks. Neural Comput Appl. https://doi.org/10.1007/s00521-019-04212-x

    Article  Google Scholar 

  10. Dunea D, Iordache S (2015) Time series analysis of air pollutants recorded from romanian emep stations at mountain sites. Environ Eng Manag J 14(11):2725–2735

    Article  Google Scholar 

  11. Wu Z, Fan J, Gao Y, Shang H, Song H (2019) Study on prediction model of space-time distribution of air pollutants based on artificial neural network. Environ Eng Manag J 18(7):1575–1590

    Article  Google Scholar 

  12. Huang W, Wang H, Zhao H, Wei Y (2019) Temporal-spatial characteristics and key influencing factors of PM2.5 concentrations in China based on Stirpat model and Kuznets curve. Environ Eng Manag J 18(12):2587–2604

    Article  Google Scholar 

  13. Kueh S, Kuok K (2018) Forecasting long term precipitation using cuckoo search optimization neural network models. Environ Eng Manag J 17(6):1283–1292

    Article  Google Scholar 

  14. Feng Z, Zhang Z, Zhang Q, Gongab D (2018) Evaluation of soil suitability for cultivation based on back-propagation artificial neural network: The case of Jiangxia district. Environ Eng Manag J 17(1):229–236

    Article  Google Scholar 

  15. Vrecko I, Kovac J, Rupnik B, Gajsek B (2019) Using queuing simulation model in production process innovations. Int J Simul Model 18(1):47–58

    Article  Google Scholar 

  16. Kim K, Lee W (2004) Stock market prediction using artificial neural networks with optimal feature transformation. Neural Comput Appl. https://doi.org/10.1007/s00521-004-0428-x

    Article  Google Scholar 

  17. Xu Q, Wang L, Jiang C, Liu Y (2020) A novel (U)MIDAS-SVR model with multi-source market sentiment for forecasting stock returns. Neural Comput Appl. https://doi.org/10.1007/s00521-019-04063-6

    Article  Google Scholar 

  18. Chung H, Shin K (2020) Genetic algorithm-optimized multi-channel convolutional neural network for stock market prediction. Neural Comput Appl. https://doi.org/10.1007/s00521-019-04236-3

    Article  Google Scholar 

  19. White H (1988) Economic perdication using neural networks: the case of ibm daily stock returns. Earth Surf Proc Land 8(5):409–422

    Google Scholar 

  20. Zhang G (2003) Time series forecasting using a hybrid ARIMA and neural network model. Neurocomputing 50:159–175

    Article  Google Scholar 

  21. Hammad AAA, Ali SMA, Hall EL (2007) Forecasting the Jordanian stock price using artificial neural network. In: Intelligent engineering systems through artificial neural networks, vol 17. Digital Collection of The American Society of Mechanical Engineers, pp 1–6. https://doi.org/10.1115/1.802655.paper42

  22. Wang D, Liu X, Wang D (2013) A DT-SVM strategy for stock futures prediction with big data. Computational science and engineering. Sydney, NSW, Australia IEEE 2013:1005–1012

    Google Scholar 

  23. Nayak S, Misra B, Behera H (2015) Artificial chemical reaction optimization of neural networks for efficient prediction of stock market indices. Ain Shams Eng J. https://doi.org/10.1016/j.asej.2015.07.015

    Article  Google Scholar 

  24. Wang P, Lou Y, Lei L (2017) Research on Stock Price Prediction Based on BP Wavelet Neural Network with Mexico Hat Wavelet Basis. In: Proceedings of the 2017 International Conference on Education, Economics and Management Research (ICEEMR 2017). https://doi.org/10.2991/iceemr-17.2017.25

  25. Hu Y (2018) Stock market timing model based on convolutional neural network—Taking Shanghai Composite Index as an example. Finance Econ 2018(04):71–74

    Google Scholar 

  26. Zeng A, Nie W (2019) Stock Recommendation System Based on Deep Bidirectional LSTM. Comput Sci 46(10):84–89

    Google Scholar 

  27. Lecun Y, Botou L, Bengio Y, Haffner P (1998) Gradient-based learning applied to document recognition. Proc IEEE 86(11):2278–2324

    Article  Google Scholar 

  28. Qin L, Yu N, Zhao D (2018) Applying the convolutional neural network deep learning technology to behavioural recognition in intelligent video. Tehnicki vjesnik Tech Gaz 25(2):528–535

    Google Scholar 

  29. Hao Y, Gao Q (2020) Predicting the trend of stock market index using the hybrid neural network based on multiple time scale feature learning. Appl Sci 10(11):3961–3974

    Article  Google Scholar 

  30. Kamalov F (2020) Forecasting significant stock price changes using neural networks. Neural Comput Appl. https://doi.org/10.1007/s00521-020-04942-3

    Article  Google Scholar 

  31. Hochreiter S, Schmidhuber J (1997) Long Short-Term Memory. MIT Press 9(8):1735-1780

  32. Ta V, Liu C, Tadesse D (2020) Portfolio optimization-based stock prediction using long-short term memory network in quantitative trading. Appl Sci 10(2):437–456

    Article  Google Scholar 

  33. Borovkova S, Tsiamas I (2019) An ensemble of LSTM neural networks for high-frequency stock market classification. J Forecast 38(6):600–619

    Article  MathSciNet  Google Scholar 

  34. Livieris I, Pintelas E, Pintelas A (2020) A CNN–LSTM model for gold price time-series forecasting. Neural Comput Appl. https://doi.org/10.1007/s00521-020-04867-x

    Article  MATH  Google Scholar 

  35. Yan X, Weihan W, Chang M (2020) Research on financial assets transaction prediction model based on LSTM neural network. Neural Comput Appl. https://doi.org/10.1007/s00521-020-04992-7

    Article  Google Scholar 

  36. Treisman A, Gelade G (1980) A feature-integration theory of attention. Cogn Psychol 12(1):97–146

    Article  Google Scholar 

Download references

Funding

This work was funded by Key projects of Humanities and Social Sciences in Colleges and universities of Hebei Province, Grant SD201010, Soft science special project of Hebei Province innovation ability improvement program, Grant 205576142D, and Foundation of Hebei University of Science and Technology, Grant 2019-ZDB02.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Wenjie Lu.

Ethics declarations

Conflict of Interest

The authors declare that they have no conflict of interest.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Lu, W., Li, J., Wang, J. et al. A CNN-BiLSTM-AM method for stock price prediction. Neural Comput & Applic 33, 4741–4753 (2021). https://doi.org/10.1007/s00521-020-05532-z

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00521-020-05532-z

Keywords

Navigation