Skip to main content

Stock-Pred: The LSTM Prophet of the Stock Market

  • Conference paper
  • First Online:
Optimization, Learning Algorithms and Applications (OL2A 2022)

Abstract

This paper presents the development process of a LSTM prophet which predicts stock market prices, based on historical data and machine learning to identify trends. Predicting prices in the stock market is a challenging task, surrounded by possible turbulent events that impact the final result. In this scenario, for the method proposed here, it is presented (i) the steps to obtain and process the used data for the applied LSTM network; (ii) the motivations for this implementation; (iii) the details regarding methodology and architecture; (iv) the neural architecture search technique used to determine the hyperparameters by tuning them through the iRace algorithm, which is responsible for structuring the network topology in a robust way; and (v) a discussion about quality measures used to compare network settings. Computational experiments in order to analyze the developed tool considered stock tickers from USA and Brazilian financial markets, in addition to the foreign exchange market involving BRL–USD. The obtained results were satisfactory in general, which achieved a high model accuracy, in relation to price tendency, and a low mean absolute percentage error, according to price values, with the analyzed test dataset.

Supported by organization the Brazilian agencies CAPES, CNPq and FAPEMIG.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 109.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 139.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Althelaya, K.A., El-Alfy, E.S.M., Mohammed, S.: Evaluation of bidirectional LSTM for short-and long-term stock market prediction. In: 9th International Conference on Information and Communication Systems (ICICS), pp. 151–156. IEEE (2018)

    Google Scholar 

  2. Baek, Y., Kim, H.Y.: 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 (2018)

    Article  Google Scholar 

  3. Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473 (2014)

  4. Cramer, S., Kampouridis, M., Freitas, A.A., Alexandridis, A.K.: An extensive evaluation of seven machine learning methods for rainfall prediction in weather derivatives. Expert Syst. Appl. 85, 169–181 (2017)

    Article  Google Scholar 

  5. Deb, K., Mohan, M., Mishra, S.: Evaluating the varepsilon-domination based multi objective evolutionary algorithm for a quick computation of pareto-optimal solutions. Evol. Comput. J. 13(4), 501–525 (2005)

    Article  Google Scholar 

  6. Deb, K., Pratap, A., Agarwal, S., Meyarivan, T.: A fast and elitist multi objective genetic algorithm: NSGA-ii. IEEE Trans. Evol. Comput. 6(2), 182–197 (2002)

    Article  Google Scholar 

  7. Edwards, R.D., Magee, J., Bassetti, W.C.: Technical Analysis of Stock Trends. CRC Press (2018)

    Google Scholar 

  8. Fama, E.F.: Efficient capital markets: a review of theory and empirical work. J. Finance 25(2), 383–417 (1970). http://www.jstor.org/stable/2325486

  9. Gandhmal, D.P., Kumar, K.: Systematic analysis and review of stock market prediction techniques. Comput. Sci. Rev. 34, 100190 (2019)

    Article  MathSciNet  Google Scholar 

  10. Giacomel, F.d.S.: Um método algorítmico para operações na bolsa de valores baseado em ensembles de redes neurais para modelar e prever os movimentos dos mercados de ações. Tese de mestrado, UFRGS (2016)

    Google Scholar 

  11. Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735–1780 (1997)

    Article  Google Scholar 

  12. Jin, Z., Yang, Y., Liu, Y.: Stock closing price prediction based on sentiment analysis and LSTM. Neural Comput. Appl. 32(13), 9713–9729 (2020)

    Article  Google Scholar 

  13. Kampouridis, M., Otero, F.E.: Evolving trading strategies using directional changes. Expert Syst. Appl. 73, 145–160 (2017)

    Article  Google Scholar 

  14. Kissell, R.: Algorithmic Trading Methods: Applications Using Advanced Statistics, Optimization, and Machine Learning Techniques. Academic Press (2021)

    Google Scholar 

  15. Liu, S., Liao, G., Ding, Y.: Stock transaction prediction modeling and analysis based on LSTM. In: 2018 13th IEEE Conference on Industrial Electronics and Applications (ICIEA), pp. 2787–2790. IEEE (2018)

    Google Scholar 

  16. López-Ibáñez, M., Dubois-Lacoste, J., Cáceres, L.P., Birattari, M., Stützle, T.: The irace package: iterated racing for automatic algorithm configuration. Oper. Res. Perspect. 3, 43–58 (2016)

    MathSciNet  Google Scholar 

  17. Malkiel, B.G.: A random walk down wall street. w. w (1973)

    Google Scholar 

  18. Mohamed, I., Otero, F.E.: A multi objective optimization approach for market timing. In: Proceedings of the 2020 Genetic and Evolutionary Computation Conference, pp. 22–30 (2020)

    Google Scholar 

  19. Nakagawa, S., Schielzeth, H.: A general and simple method for obtaining R2 from generalized linear mixed-effects models. Methods Ecol. Evol. 4(2), 133–142 (2013)

    Article  Google Scholar 

  20. Nelson, D.M., Pereira, A.C., de Oliveira, R.A.: Stock market’s price movement prediction with LSTM neural networks. In: 2017 International Joint Conference on Neural Networks (IJCNN), pp. 1419–1426. IEEE (2017)

    Google Scholar 

  21. Palepu, K.G., Healy, P.M., Wright, S., Bradbury, M., Coulton, J.: Business Analysis and Valuation: Using Financial Statements. Cengage AU (2020)

    Google Scholar 

  22. Rondel, G., Hilkner, R.: Técnicas de redes neurais para análise e previsão do mercado de ações. Relatório de Graduação, Projeto Final, UNICAMP (2019)

    Google Scholar 

  23. Sahni, R.: Analysis of stock market behaviour by applying chaos theory. In: 2018 9th International Conference on Computing, Communication and Networking Technologies (ICCCNT), pp. 1–4. IEEE (2018)

    Google Scholar 

  24. Shah, D., Isah, H., Zulkernine, F.: Stock market analysis: a review and taxonomy of prediction techniques. Int. J. Financ. Stud. 7(2), 26 (2019)

    Article  Google Scholar 

  25. Woodruff, M., Herman, J.: pareto.py: a varepsilon-non-domination sorting routine (2013). https://github.com/matthewjwoodruff/pareto.py

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Thiago Figueiredo Costa .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Costa, T.F., da Cruz, A.R. (2022). Stock-Pred: The LSTM Prophet of the Stock Market. In: Pereira, A.I., Košir, A., Fernandes, F.P., Pacheco, M.F., Teixeira, J.P., Lopes, R.P. (eds) Optimization, Learning Algorithms and Applications. OL2A 2022. Communications in Computer and Information Science, vol 1754. Springer, Cham. https://doi.org/10.1007/978-3-031-23236-7_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-23236-7_21

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-23235-0

  • Online ISBN: 978-3-031-23236-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics