Enhancing Stock Price Prediction Using Stacked Long Short-Term Memory

Authors

  • Mohammad Diqi Departement of Informatics, Universitas Respati Yogyakarta
  • I Wayan Ordiyasa Departement of Informatics, Universitas Respati Yogyakarta
  • Hamzah Hamzah Departement of Informatics, Universitas Respati Yogyakarta

DOI:

https://doi.org/10.25299/itjrd.2023.13486

Keywords:

Stock price prediction, Stacked LSTM, Financial markets, Indonesia Stock Exchange, Deep learning

Abstract

This research explores the Stacked Long Short-Term Memory (LSTM) model for stock price prediction using a dataset obtained from Yahoo Finance. The main objective is to assess the effectiveness of the model in capturing stock price patterns and making accurate predictions. The dataset consists of stock prices for the top 10 companies listed in the Indonesia Stock Exchange from July 6, 2015, to October 14, 2021. The model is trained and evaluated using metrics such as RMSE, MAE, MAPE, and R2. The average values of these metrics for the predictions indicate promising results, with an average RMSE of 0.00885, average MAE of 0.00800, average MAPE of 0.02496, and an average R2 of 0.9597. These findings suggest that the Stacked LSTM model can effectively capture stock price patterns and make accurate predictions. The research contributes to the field of stock price prediction and highlights the potential of deep learning techniques in financial forecasting.

Downloads

Download data is not yet available.

References

M. L. Challa, V. Malepati, and S. N. R. Kolusu, “S&P BSE Sensex and S&P BSE IT return forecasting using ARIMA,” Financial Innovation, vol. 6, no. 1, p. 47, Nov. 2020, doi: 10.1186/s40854-020-00201-5.

Q. Wang, K. Kang, Z. Zhang, and D. Cao, “Application of LSTM and CONV1D LSTM Network in Stock Forecasting Model,” artif. intell. adv., vol. 3, no. 1, pp. 36–43, Apr. 2021, doi: 10.30564/aia.v3i1.2790.

W. Abbassi, A. I. Hunjra, S. M. Alawi, and R. Mehmood, “The Role of Ownership Structure and Board Characteristics in Stock Market Liquidity,” International Journal of Financial Studies, vol. 9, no. 4, 2021, doi: 10.3390/ijfs9040074.

F. Rahimi and S. A. Mousavian Anaraki, “Proposing an Innovative Model Based on the Sierpinski Triangle for Forecasting EUR/USD Direction Changes,” J. Mon. Ec., vol. 15, no. 4, pp. 423–444, Oct. 2020, doi: 10.52547/jme.15.4.423.

H. D. Chacón, E. Kesici, and P. Najafirad, “Improving Financial Time Series Prediction Accuracy Using Ensemble Empirical Mode Decomposition and Recurrent Neural Networks,” IEEE Access, vol. 8, pp. 117133–117145, 2020, doi: 10.1109/ACCESS.2020.2996981.

Y. Cui and L. Liu, “Investor sentiment-aware prediction model for P2P lending indicators based on LSTM,” PLOS ONE, vol. 17, no. 1, p. e0262539, Jan. 2022, doi: 10.1371/journal.pone.0262539.

D. Long, X. Wen, J. Wang, and B. Wei, “A Data Fusion Fault Diagnosis Method Based on LSTM and DWT for Satellite Reaction Flywheel,” Mathematical Problems in Engineering, vol. 2020, p. 2893263, Sep. 2020, doi: 10.1155/2020/2893263.

T. F. Costa, E. F. Wanner, F. avio V. C. Martins, and A. e R. da Cruz, “A Methodology for Definition and Refinement of a LSTM Stock Predictor Architecture using iRace and NSGA-II,” in Anais do I Brazilian Workshop on Artificial Intelligence in Finance (BWAIF 2022), Sociedade Brasileira de Computaç∼ ao, Jul. 2022. doi: 10.5753/bwaif.2022.222869.

I. A. Bairagi, A. Daniel, and A. Sharma, “A Study of LSTM in Stock Price Prediction,” in 2022 4th International Conference on Advances in Computing, Communication Control and Networking (ICAC3N), IEEE, Dec. 2022. doi: 10.1109/icac3n56670.2022.10074373.

J. M.-T. Wu, Z. Li, N. Herencsar, B. Vo, and J. C.-W. Lin, “A graph-based CNN-LSTM stock price prediction algorithm with leading indicators,” Multimedia Systems, vol. 29, no. 3, pp. 1751–1770, Feb. 2021, doi: 10.1007/s00530-021-00758-w.

G. Chang, J. Qiao, Y. Liu, Y. Wang, and Z. Zhang, “A Perspective of LSTM Based Stock Prediction,” in 2021 International Wireless Communications and Mobile Computing (IWCMC), IEEE, Jun. 2021. doi: 10.1109/iwcmc51323.2021.9498944.

A. Yadav, C. K. Jha, and A. Sharan, “Optimizing LSTM for time series prediction in Indian stock market,” Procedia Computer Science, vol. 167, pp. 2091–2100, 2020, doi: 10.1016/j.procs.2020.03.257.

L. Li, J. Yan, X. Yang, and Y. Jin, “Learning Interpretable Deep State Space Model for Probabilistic Time Series Forecasting,” in Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, International Joint Conferences on Artificial Intelligence Organization, Aug. 2019. doi: 10.24963/ijcai.2019/402.

F. Qian and X. Chen, “Stock Prediction Based on LSTM under Different Stability,” in 2019 IEEE 4th International Conference on Cloud Computing and Big Data Analysis (ICCCBDA), IEEE, Apr. 2019. doi: 10.1109/icccbda.2019.8725709.

Z. Zou and Zihao Qu, “Using LSTM in Stock prediction and Quantitative Trading.”

G. Ding and L. Qin, “Study on the prediction of stock price based on the associated network model of LSTM,” International Journal of Machine Learning and Cybernetics, vol. 11, no. 6, pp. 1307–1317, Nov. 2019, doi: 10.1007/s13042-019-01041-1.

S. Liu, G. Liao, and Y. Ding, “Stock transaction prediction modeling and analysis based on LSTM,” in 2018 13th IEEE Conference on Industrial Electronics and Applications (ICIEA), IEEE, May 2018. doi: 10.1109/iciea.2018.8398183.

K. A. Althelaya, E.-S. M. El-Alfy, and S. Mohammed, “Evaluation of bidirectional LSTM for short-and long-term stock market prediction,” in 2018 9th International Conference on Information and Communication Systems (ICICS), IEEE, Apr. 2018. doi: 10.1109/iacs.2018.8355458.

B. Jaswanth and J. Kaushik, “Stacked LSTM a Deep Learning model to predict Stock market,” in 2022 4th International Conference on Advances in Computing, Communication Control and Networking (ICAC3N), IEEE, Dec. 2022. doi: 10.1109/icac3n56670.2022.10074222.

Y. Zhang, G. Chu, and D. Shen, “The role of investor attention in predicting stock prices: The long short-term memory networks perspective,” Finance Research Letters, vol. 38, 2021, doi: 10.1016/j.frl.2020.101484.

R. Uddin, F. I. Alam, A. Das, and S. Sharmin, “Multi-Variate Regression Analysis for Stock Market price prediction using Stacked LSTM,” in 2022 International Conference on Innovations in Science, Engineering and Technology (ICISET), IEEE, Feb. 2022. doi: 10.1109/iciset54810.2022.9775911.

S. Banyal*, P. Goel, and D. Grover, “Indian Stock-Market Prediction using Stacked LSTM AND Multi-Layered Perceptron,” International Journal of Innovative Technology and Exploring Engineering, vol. 9, no. 3, pp. 1051–1055, Jan. 2020, doi: 10.35940/ijitee.c8026.019320.

U. Cali and V. Sharma, “Short-term wind power forecasting using long-short term memory based recurrent neural network model and variable selection,” IJSGCE, pp. 103–110, 2019, doi: 10.12720/sgce.8.2.103-110.

J. Park and E. Hwang, “A Two-Stage Multistep-Ahead Electricity Load Forecasting Scheme Based on LightGBM and Attention-BiLSTM,” Sensors, vol. 21, no. 22, 2021, doi: 10.3390/s21227697.

Downloads

Published

2024-03-27

How to Cite

Diqi, M., Ordiyasa, I. W., & Hamzah, H. (2024). Enhancing Stock Price Prediction Using Stacked Long Short-Term Memory. IT Journal Research and Development, 8(2), 164–174. https://doi.org/10.25299/itjrd.2023.13486

Issue

Section

Articles