Skip to main content
Log in

Visualization and forecasting of stock’s closing price using machine learning

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

Abstract

Stock market investments have become an essential part of our lives as they offer a means of growing wealth and securing financial stability for individuals and businesses alike. However, predicting and investing in a stock is a complex method and demands significant levels of knowledge, proficiency, and skill. Stock market prediction is the act of analyzing historical information and trends in the market in order to make informed forecasts about the potential future worth of a given stock or instrument that is traded on a financial instrument exchange. When making stock predictions, most stockbrokers use both fundamental and technical analysis and time series analysis. The study focuses on the implementation of Multi-Linear Regression, LSTM, CNN, and LSTM + GRU based Machine learning techniques using technical analysis to predict stock’s closing values from the NYSE, and NASDAQ markets for multiple days. The dataset has been taken from Yahoo, of 10-year span. The factors taken into consideration for predicting stock prices are open, close, low, and high. The model’s effectiveness is measured using common strategic metrics like RMSE, MSE, MAE, and R2. A lower value for these variables suggests that the models are good at forecasting stock closing prices. After conducting a comprehensive evaluation, we found that LSTM + GRU model performs the best among the tested models for predicting multiple days, followed by CNN and LSTM. The tested models demonstrate a remarkable level of accuracy in predicting stock market prices. This research work provides a valuable contribution to the fields of financial and technical analysis in the stock market research community.

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

Data availability

We used publicly available datasets from Yahoo Finance (https://finance.yahoo.com) (for the time period April 2013 to 31 March 2023).

References

  1. Fathali Z, Kodia Z, Ben Said L (2022) Stock market prediction of Nifty 50 index applying machine learning techniques. Appl Artif Intell 36(1):2111134

    Article  Google Scholar 

  2. Gupta A, Joshi K, Patel M, Pratap MV (2023) Stock prices prediction using machine learning. In: 2023 2nd International Conference for Innovation in Technology (INOCON), . IEEE, pp 1–7. https://doi.org/10.1109/INOCON57975.2023.10101226

  3. Aldhyani TH, Alzahrani A (2022) Framework for predicting and modeling stock market prices based on deep learning algorithms. Electronics 11(19):3149

    Article  Google Scholar 

  4. What Is Stock Price Prediction? Wikipedia contributors, “Stock market prediction,” Wikipedia, The Free Encyclopedia, 03-Apr-2023. [Online]. Available: https://en.wikipedia.org/w/index.php?title=Stock_market_prediction&oldid=1147956250. Accessed 15 Apr 2023

  5. De Prado ML (2018) Advances in financial machine learning. John Wiley & Sons

    Google Scholar 

  6. Hilpisch Y (2014) Python for finance: analyze big financial data. " O'Reilly Media, Inc."

  7. Omar AB, Huang S, Salameh AA, Khurram H, Fareed M (2022) Stock market forecasting using the random forest and deep neural network models before and during the COVID-19 period. Front Environ Sci 10:917047. https://doi.org/10.3389/fenvs.2022.917047

  8. Xiao D, Su J (2022) Research on stock price time series prediction based on deep learning and autoregressive integrated moving average. Sci Program. https://doi.org/10.1155/2022/4758698

  9. Shen J, Shafiq MO (2020) Short-term stock market price trend prediction using a comprehensive deep learning system. J Big Data 7(1):1–33

    Article  CAS  Google Scholar 

  10. Chandola D, Mehta A, Singh S, Tikkiwal VA, Agrawal H (2023) Forecasting directional movement of stock prices using deep learning. Ann Data Sci 10(5):1361–1378

    Article  Google Scholar 

  11. Ji X, Wang J, Yan Z (2021) A stock price prediction method based on deep learning technology. Int J Crowd Sci 5(1):55–72

    Article  Google Scholar 

  12. Wei J, Xu Q, He C (2022) Deep learning of predicting closing price through historical adjustment closing price. Proc Comput Sci 202:379–384

    Article  Google Scholar 

  13. Sen J, Mehtab S (2021) Design and analysis of robust deep learning models for stock price prediction. Mach Learn–Algoritms Model Appl 15–46. https://doi.org/10.5772/intechopen.99982

  14. Bhandari HN, Rimal B, Pokhrel NR, Rimal R, Dahal KR, Khatri RK (2022) Predicting stock market index using LSTM. Mach Learn Appl 9:100320

    Google Scholar 

  15. de la Fuente AR, Sanchez-Ramirez E, Calderón-Alvarado MP, Segovia-Hernandez JG, Hernández-Vargas EA (2022) Development of Deep Learning Architectures for Forecasting Distillation Columns Dynamic Behavior of Biobutanol Purification. In Computer Aided Chemical Engineering (vol 51, pp 49–54). Elsevier

  16. Yujun Y, Yimei Y, Jianhua X (2020) A hybrid prediction method for stock price using LSTM and ensemble EMD. Complexity 2020:1–16

    Article  ADS  Google Scholar 

  17. Saxena S (2021) Introduction to gated recurrent unit (GRU). Analytics Vidhya. [Online]. Available: https://www.analyticsvidhya.com/blog/2021/03/introduction-to-gated-recurrent-unit-gru/. [Accessed: 30-Apr-2023]

  18. Zhou GB, Wu J, Zhang CL, Zhou ZH (2016) Minimal gated unit for recurrent neural networks. Int J Autom Comput 13(3):226–234. https://doi.org/10.1007/s11633-016-1006-2

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Vibha Pratap.

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

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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Gupta, A., ., A., Joshi, K. et al. Visualization and forecasting of stock’s closing price using machine learning. Multimed Tools Appl (2024). https://doi.org/10.1007/s11042-024-18376-9

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11042-024-18376-9

Keywords

Navigation