Skip to main content
Log in

Combining LSTM and CNN methods and fundamental analysis for stock price trend prediction

  • Published:
Multimedia Tools and Applications Aims and scope Submit manuscript

Abstract

Stock market trend prediction has always been a major challenge for investors. In this paper, the combination of Convolutional Neural Network and long short-term memory methods, as well as fundamental analysis components such as P/E ratio, profitability and the number of company transactions have been used to increase the performance and reduce the model error in stock price trend prediction. To evaluate the model, the parameters of evaluating mean absolute error and mean absolute percentage error in four groups of financial, petroleum, basic metals and non-metallic minerals were employed, the results of which indicated an increase in the performance and a reduction in error. According to the results, in the financial group, we obtained 0.49 for the mean absolute percentage error and 4.30 the for mean absolute error. In petroleum group, mean absolute percentage error is 0.33 and mean absolute error equals 3.64. In basic metals group, mean absolute percentage error is 0.29 and mean absolute error equals 2.39. Finally, in non-metallic minerals group, we achieved 0.73 for mean absolute percentage error and 6.16 for mean absolute error. The values obtained in the proposed method show the effect of the model on the performance and prediction of error.

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
Fig. 15
Fig. 16
Fig. 17
Fig. 18

Similar content being viewed by others

Code availability

Code is available at https://github.com/ZahraNourbakhsh/stock-market-prediction-lstm-and-cnn

Notes

  1. Auto Regressive Integer Moving Average

  2. Generalized Autoregressive Conditional heteroskedasticity

  3. back propagation

  4. improved bacterial chemotaxis optimization

  5. Bank of Central Asia

References

  1. Agarap AF (2018) Deep learning using rectified linear units (relu). arXiv preprint arXiv:1803.08375

  2. Ariyo AA, Adewumi AO, Ayo CK (2014) "Stock price prediction using the ARIMA model," in 2014 UKSim-AMSS 16th International Conference on Computer Modelling and Simulation, IEEE, pp. 106–112

  3. Baek Y, Kim HY (2018) ModAugNet: a new forecasting framework for stock market index value with an overfitting prevention LSTM module and a prediction LSTM module. Expert Syst Appl 113:457–480

    Article  Google Scholar 

  4. Bahi M, Batouche M (2018) "Deep learning for ligand-based virtual screening in drug discovery," in 2018 3rd International Conference on Pattern Analysis and Intelligent Systems (PAIS), IEEE, pp. 1–5

  5. Baldo A, Cuzzocrea A, Fadda E, Bringas PG (2021) "Financial forecasting via deep-learning and machine-learning tools over two-dimensional objects transformed from time series," in International conference on hybrid artificial intelligence systems, Springer, pp. 550–563

  6. Behera RK, Das S, Rath SK, Misra S, Damasevicius R (2020) Comparative study of real time machine learning models for stock prediction through streaming data. J Univ Comput Sci 26(9):1128–1147

    Google Scholar 

  7. Bhuvaneshwari M, Kanaga EGM (2021) "Convolutional Neural Network for Addiction Detection using Improved Activation Function," in 2021 5th International Conference on Computing Methodologies and Communication (ICCMC), IEEE, pp. 996–1000

  8. Budiharto W (2021) Data science approach to stock prices forecasting in Indonesia during Covid-19 using Long short-term memory (LSTM). J Big Data 8(1):1–9

    Article  Google Scholar 

  9. Cai Q, Zhang D, Wu B, Leung SC (2013) A novel stock forecasting model based on fuzzy time series and genetic algorithm. Procedia Comput Science 18:1155–1162

  10. Chen Y-J, Chen Y-M, Lu CL (2017) Enhancement of stock market forecasting using an improved fundamental analysis-based approach. Soft Comput 21(13):3735–3757

    Article  Google Scholar 

  11. Chen Y et al. (2021) "Stock price forecast based on CNN-BiLSTM-ECA model," Sci Program, vol. 2021

  12. Chen K, Franko K, Sang R (2021) "Structured Model Pruning of Convolutional Networks on Tensor Processing Units," arXiv preprint arXiv:2107.04191

  13. Chung H, Shin K-S (2018) Genetic algorithm-optimized long short-term memory network for stock market prediction. Sustain 10(10):3765

    Article  Google Scholar 

  14. Chung H, Shin K-S (2020) Genetic algorithm-optimized multi-channel convolutional neural network for stock market prediction. Neural Comput & Applic 32(12):7897–7914

    Article  Google Scholar 

  15. Coyle EJ, Lin J-H (1988) Stack filters and the mean absolute error criterion. IEEE Trans Acoust Speech Signal Process 36(8):1244–1254

    Article  MATH  Google Scholar 

  16. Das SP, Padhy S (2018) A novel hybrid model using teaching–learning-based optimization and a support vector machine for commodity futures index forecasting. Int J Mach Learn Cybern 9(1):97–111

    Article  Google Scholar 

  17. DeMark TR (1994) The new science of technical analysis. John Wiley & Sons, pp 1–243

  18. Fischer T, Krauss C (2018) Deep learning with long short-term memory networks for financial market predictions. Eur J Oper Res 270(2):654–669

    Article  MathSciNet  MATH  Google Scholar 

  19. Ganster H, Pinz P, Rohrer R, Wildling E, Binder M, Kittler H (2001) Automated melanoma recognition. IEEE Trans Med Imaging 20(3):233–239

    Article  Google Scholar 

  20. Kim K-J, Han I (2000) Genetic algorithms approach to feature discretization in artificial neural networks for the prediction of stock price index. Expert Syst Appl 19(2):125–132

    Article  Google Scholar 

  21. Hiransha M, Gopalakrishnan EA, Menon VK, Soman K (2018) NSE stock market prediction using deep-learning models. Procedia Comput Sci 132:1351–1362

    Article  Google Scholar 

  22. Hoseinzade E, Haratizadeh S (2019) CNNpred: CNN-based stock market prediction using a diverse set of variables. Expert Syst Appl 129:273–285

    Article  Google Scholar 

  23. Lin Z (2018) Modelling and forecasting the stock market volatility of SSE composite index using GARCH models. Futur Gener Comput Syst 79:960–972

    Article  Google Scholar 

  24. Liu Z (2011) A method of SVM with normalization in intrusion detection. Procedia Environ Sci 11:256–262

    Article  Google Scholar 

  25. Livieris IE, Kotsilieris T, Stavroyiannis S, Pintelas P (2020) Forecasting stock price index movement using a constrained deep neural network training algorithm. Intell Decis Technol 14(3):313–323

  26. Long J, Chen Z, He W, Wu T, Ren J (2020) An integrated framework of deep learning and knowledge graph for prediction of stock price trend: an application in Chinese stock exchange market. Appl Soft Comput 91:106205

    Article  Google Scholar 

  27. Merh N, Saxena VP, Pardasani KR (2010) A comparison between hybrid approaches of ANN and ARIMA for Indian stock trend forecasting. Bus Intell  J 3(2):23–43

  28. Moghar A, Hamiche M (2020) Stock market prediction using LSTM recurrent neural network. Procedia Comput Sci 170:1168–1173

    Article  Google Scholar 

  29. Nabipour M, Nayyeri P, Jabani H, Mosavi A, Salwana E (2020) Deep learning for stock market prediction. Entropy 22(8):840

    Article  Google Scholar 

  30. Olah C (2015) "Understanding lstm networks,"

  31. Patel J, Shah S, Thakkar P, Kotecha K (2015) Predicting stock and stock price index movement using trend deterministic data preparation and machine learning techniques. Expert Syst Appl 42(1):259–268

  32. Pawar K, Jalem RS, Tiwari V (2019) "Stock market price prediction using LSTM RNN," in emerging trends in expert applications and security: Springer, pp. 493–503

  33. Qian B, Rasheed K (2007) Stock market prediction with multiple classifiers. Appl Intell 26(1):25–33

    Article  Google Scholar 

  34. Rostami M, Forouzandeh S, Berahmand K, Soltani M (2020) Integration of multi-objective PSO based feature selection and node centrality for medical datasets. Genomics 112(6):4370–4384

    Article  Google Scholar 

  35. Rostami M, Berahmand K, Forouzandeh S (2020) A novel method of constrained feature selection by the measurement of pairwise constraints uncertainty. J Big Data 7(1):1–21

  36. Rostami M, Berahmand K, Forouzandeh S (2021) A novel community detection based genetic algorithm for feature selection. J Big Data 8(1):1–27

  37. Rostami M, Berahmand K, Nasiri E, Forouzande S (2021) Review of swarm intelligence-based feature selection methods. Eng Appl Artif Intell 100:104210

    Article  Google Scholar 

  38. Saud AS, Shakya S (2020) Analysis of look back period for stock price prediction with RNN variants: a case study on banking sector of NEPSE. Procedia Comput Sci 167:788–798

  39. Selvin S, Vinayakumar R, Gopalakrishnan E, Menon VK, Soman K (2017) Stock price prediction using LSTM, RNN and CNN-sliding window model. In: 2017 international conference on advances in computing, communications and informatics (icacci). IEEE, pp 1643–1647

  40. Sharma S, Sharma S, Athaiya A (2017) Activation functions in neural networks. Towards Data Science 6(12):310–316

  41. Sim HS, Kim HI, Ahn JJ (2019) Is deep learning for image recognition applicable to stock market prediction? Complexity 2019. https://doi.org/10.1155/2019/4324878

  42. Thakkar A, Chaudhari K (2020) CREST: cross-reference to exchange-based stock trend prediction using long short-term memory. Procedia Comput Sci 167:616–625

    Article  Google Scholar 

  43. Tsantekidis A, Passalis N, Tefas A, Kanniainen J, Gabbouj M, Iosifidis A (2017) Forecasting stock prices from the limit order book using convolutional neural networks. In: 2017 IEEE 19th conference on business informatics (CBI), vol. 1. IEEE, pp 7–12

  44. Valueva MV, Nagornov N, Lyakhov PA, Valuev GV, Chervyakov NI (2020) Application of the residue number system to reduce hardware costs of the convolutional neural network implementation. Math Comput Simul 177:232–243

    Article  MathSciNet  MATH  Google Scholar 

  45. Wang W, Gang J (2018) "Application of convolutional neural network in natural language processing," in 2018 International Conference on Information Systems and Computer Aided Education (ICISCAE), IEEE, pp. 64–70

  46. Wong WK, Manzur M, Chew BK (2003) How rewarding is technical analysis? Evidence from Singapore stock market. Appl Financial Econ 13(7):543–551

  47. Wu JM-T, Sun L, Srivastava G, Lin JC-W (2021) A novel synergetic lstm-ga stock trading suggestion system in internet of things. Mob Inf Syst 2021

  48. Yadav A, Jha C, Sharan A (2020) Optimizing LSTM for time series prediction in Indian stock market. Procedia Comput Sci 167:2091–2100

    Article  Google Scholar 

  49. Zhang Y, Wu L (2009) Stock market prediction of S&P 500 via combination of improved BCO approach and BP neural network. Expert Syst Appl 36(5):8849–8854

    Article  Google Scholar 

  50. Zhou X, Pan Z, Hu G, Tang S, Zhao C (2018) "Stock market prediction on high-frequency data using generative adversarial nets," Math Probl Eng, vol. 2018

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Narges Habibi.

Ethics declarations

Conflicts of interest/competing interests

The authors declare that they have no known competing financial interests or personal relation-ships that could have appeared to influence the work reported in this paper.

Additional information

Publisher’s note

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

Rights and permissions

Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Nourbakhsh, Z., Habibi, N. Combining LSTM and CNN methods and fundamental analysis for stock price trend prediction. Multimed Tools Appl 82, 17769–17799 (2023). https://doi.org/10.1007/s11042-022-13963-0

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11042-022-13963-0

Keywords

Navigation