Abstract
In this paper, recurrent neural networks consisting of GRU and LSTM architectures are used to extract meaningful insights, characteristics, and specific patterns from previously observed, equally spaced, stock market data. The long-term dependency of nonlinear time series data can be learned using GRU and LSTM. In the first phase, the sliding window technique is used to analyse the daywise (i) open, (ii) high, (iii) low, and (iv) closing values of various stocks on the stock market to forecast the future. Performance comparisons show that the proposed GRU and LSTM networks outperform the existing models in terms of prediction accuracy. Multiple datasets were compared and the findings are: (1) the proposed model has a MAPE of 0.630, while the present model’s is 1.748; (2) the MAPE of the proposed model is 0.6243, while that of the existing model is 1.92; (3) the recommended model has a MAPE of 0.7924, while the existing model’s is 0.8587; (4) the recommended model’s MAPE is 1.191, but the current model’s MAPE is 2.99. In the second phase of the process, SMA, EMA, RSI, MACD, and ADX are chosen from among the many technical indicators and used in conjunction with OHLC to further optimise the models.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Data availability
Enquiries about data availability should be directed to the authors.
Abbreviations
- b :
-
Bias
- \(\widetilde{C}\) :
-
New candidate cell state
- \(C\) :
-
Cell state
- f :
-
Forget gate
- h :
-
Output of LSTM
- \(\widetilde{h}\) :
-
Current state
- I :
-
Input gate
- k :
-
Weight factor
- n :
-
Number of days
- o :
-
Output gate
- r :
-
Reset gate
- tanh :
-
Nonlinear activation function
- z :
-
Block input
- W :
-
Weight
- X :
-
Input
- z :
-
Update gate
- t :
-
Time
- σ :
-
Sigmoid activation function
References
Althelaya KA, El-Alfy El-SM, Mohammed S (2018) Stock market forecast using multivariate analysis with bidirectional and stacked (LSTM, GRU). In: 2018 21st Saudi Computer Society National Computer Conference (NCC)
Bengio Y, Goodfellow IJ, Courville A (2015) Deep learning. Nature 521:436–444
Chen Y, Hao Y (2020) A novel framework for stock trading signals forecasting. Soft Comput 24:12111–12130
Chou J-S, Nguyen T-K (2018) Forward forecast of stock price using sliding-window metaheuristic-optimized machine learning regression. IEEE Trans Ind Inform 14(7):3232–3142
Chung J, Gulcehre C, Cho K, Bengio Y (2014) Empirical evaluation of gated recurrent neural networks on sequence modelling. arXiv preprint arXiv:1412.3555
Dey R, Salem FM (2017) Gate-variants of gated recurrent unit (GRU) neural networks. Neural and Evolutionary Computing, arXiv:1701.05923
Greff K, Rupesh KS, Jan K et al. (2017) LSTM: a search space odyssey. IEEE Trans Neural Netw Learn Syst, arXiv:1503.04069v2
Hiransha M, Gopalakrishnan EA, Menon VK, Soman KP (2018) NSE stock market prediction using deep-learning models. Procedia Comput Sci 132:1351–1362
Hochreiter S (2001) Gradient flow in recurrent nets: the difficulty of learning long-term dependencies
Hochreiter S, Schmidhuber J (1997) Long short-term memory. Neural Comput 9(8):1735–1780
Hwang G, Hwang Y, Shin S et al (2022) Comparative study on the prediction of city bus speed between LSTM and GRU. Int J Autom Technol 23(4):983–992
Khare K, Darekar O et al. (2017) Short term stock price prediction using deep learning. In: 2017 2nd IEEE International Conference On Recent Trends in Electronics Information & Communication Technology (RTEICT)
Li G, Zhang A, Zhang Q, Wu D, Zhan C (2022) Pearson correlation coefficient-based performance enhancement of broad learning system for stock price prediction. IEEE Trans Circuits Syst II Express Briefs 69(5):2413–2415
Makridakis S, Wheelwright SC, Hyndman RJ (2008) Forecasting methods and applications, 3rd edn. Wiley
Mendelsohn LB (2000) Trend forecasting with technical analysis. Published by Marketplace Books, ISBN 1-883272-91-2
Mokhtari S, Yen KK, Liu J (2021) Effectiveness of artificial intelligence in stock market prediction based on machine learning. Int J Comput Appl (0975–8887), arXiv:2107.01031
Olah C (2015) Understanding LSTM networks, internet access: colah.github.io [Aug. 27, 2015]
Paluch M, Jackowska-Strumiłło L (2014) The influence of using fractal analysis in hybrid MLP model for shortterm forecast of close prices on Warsaw Stock Exchange. In: Federated Conference on Computer Science and Information Systems, 7–10 Sep., Warsaw, pp 111–118
Raj P, Mehta A, Singh B (2023) Stock market prediction using deep learning algorithm: an overview. In: Gupta D, Khanna A, Bhattacharyya S, Hassanien AE, Anand S, Jaiswal A (eds) International Conference on Innovative Computing and Communications. Lecture Notes in Networks and Systems, vol 471. Springer, Singapore. https://doi.org/10.1007/978-981-19-2535-1_25
Rekha KS, Sabu MK (2021) Stock market prediction using deep learning. In: International conference on Communication, Control and Information Sciences, 2021 IEEE
Sadon AN, Ismail S, Jafri NS, Shaharudin SM (2021) Long short-term vs gated recurrent unit recurrent neural network for google stock price prediction. In: 2021 2nd International Conference on Artificial Intelligence and Data Sciences (AiDAS). 978-1-6654-1726-6/21
Selvamuthu D, Kumar V, Mishra A (2019) Indian stock market prediction using artificial neural networks on tick data. Financ Innov 5:16. https://doi.org/10.1186/s40854-019-0131-7
Selvin S, Vinayakumar R, Gopalakrishnan EA, Menon VK, Soman KP (2017) Stock price prediction using LSTM, RNN and CNN-Sliding window model. In: International conference on Advances in Computing, Communications and informatics, pp 1643–1647
Shen J, Shafiq MO (2020) Short-term stock market price trend prediction using a comprehensive deep learning system. J Big Data 7:66. https://doi.org/10.1186/s40537-020-00333-6
Shen G, Tan Q, Zhang H, Zeng P, Xu J (2018) Deep learning with gated recurrent unit networks for financial sequence predictions. Procedia Comput Sci 131:895–903
Sutskever I, Vinyals O, Le Q V (2014) Sequence to sequence learning with neural networks. arXiv preprint arXiv:1409.3215
Thakkar A, Chaudhari K (2021) A comprehensive survey on deep neural networks for stock market: the need, challenges, and future directions. 11 March 2021 0957- 4174/c 2021 Elsevier Ltd
Funding
The authors have not disclosed any funding.
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The 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
This article does not contain any studies with human participants, so informed consent is not applicable here.
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 (e.g. a society or other partner) 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.
About this article
Cite this article
Sivadasan, E.T., Mohana Sundaram, N. & Santhosh, R. Stock market forecasting using deep learning with long short-term memory and gated recurrent unit. Soft Comput 28, 3267–3282 (2024). https://doi.org/10.1007/s00500-023-09606-7
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00500-023-09606-7