Comparative Analysis of CNN, LSTM, and CNN–LSTM for Indonesian Stock Prediction

Authors

  • Setiawan Joddy Bina Nusantara University

DOI:

https://doi.org/10.21512/emacsjournal.v7i3.14326

Keywords:

CNN, LSTM, Deep Learning, Indonesian Stock Exchange (IDX30), Stock Market Prediction

Abstract

Predicting the stock market remains a challenging task brought by the nonlinear, volatile, and dynamic nature of financial time series. While deep learning techniques have been widely applied in developed markets, studies in emerging markets such as Indonesia remain scarce. This study conducts a comparative analysis of three deep learning models—Convolutional Neural Networks (CNN), Long Short-Term Memory networks (LSTM), and a hybrid CNN–LSTM—on five randomly selected constituents of the IDX30 index. The data range from January 2020 to December 2024, providing a general view of stock movement in recent years. The models were trained on daily OHLCV (Open, High, Low, Close, Volume) data, which was formatted using a sliding-window approach. Results show that LSTM achieved the lowest RMSE of 0.0222 ± 0.0030, MAE of 0.0172 ± 0.0015, and the highest R² of 0.889 ± 0.068. The Hybrid model delivered intermediate performance, improving upon CNN but not surpassing LSTM. These findings confirm that LSTM networks are particularly effective for stock price forecasting in the Indonesian market, while hybrid CNN–LSTM architectures can provide complementary strengths by balancing short-term feature learning with long-term temporal dependencies.

Dimensions

Plum Analytics

Author Biography

Setiawan Joddy, Bina Nusantara University

Computer Science Program, Computer Science Department, School of Computer Science

References

Aswini, J., S, D., Lakshmipriya, C., M, L. K., & R, S. S. (2024). Stock Market Forecasting Using LSTM. 2024 2nd World Conference on Communication & Computing (WCONF), 1–4. https://doi.org/10.1109/WCONF61366.2024.10692057

Bhardwaj, A., & Singh, U. P. (2023). An Empirical Study on: Time Series Forecasting of Amazon Stock Prices using Neural Networks LSTM and GAN models. Proceedings of the 5th International Conference on Information Management & Machine Intelligence, 1–10. https://doi.org/10.1145/3647444.3652440

Choudhury, S., Basak, S., Roy, S., & Das, A. K. (2023). Long-Short Term Memory Based Stock Market Analysis. 2023 7th International Conference on Electronics, Materials Engineering & Nano-Technology (IEMENTech), 1–5. https://doi.org/10.1109/IEMENTech60402.2023.10423465

Dadhich, M., Pahwa, M. S., Jain, V., & Doshi, R. (2021). Predictive Models for Stock Market Index Using Stochastic Time Series ARIMA Modeling in Emerging Economy. In G. Manik, S. Kalia, S. K. Sahoo, T. K. Sharma, & O. P. Verma (Eds.), Advances in Mechanical Engineering (pp. 281–290). Springer Singapore. https://doi.org/10.1007/978-981-16-0942-8_26

Fadziso, T. (2020). Overcoming the Vanishing Gradient Problem during Learning Recurrent Neural Nets (RNN). Asian Journal of Applied Science and Engineering, 9(1), 197–208. https://doi.org/10.18034/ajase.v9i1.41

Gupta, A., Akansha, Joshi, K., Patel, M., & Pratap, Ms. V. (2023). Stock Prices Prediction Using Machine Learning. 2023 2nd International Conference for Innovation in Technology (INOCON), 1–7. https://doi.org/10.1109/INOCON57975.2023.10101226

Hong, H., Bian, Z., & Lee, C.-C. (2021). COVID-19 and instability of stock market performance: Evidence from the U.S. Financial Innovation, 7(1), 12. https://doi.org/10.1186/s40854-021-00229-1

Jiang, M., Wang, K., Sun, Y., Chen, W., Xia, B., & Li, R. (2023). MLGN: Multi-scale local-global feature learning network for long-term series forecasting. Machine Learning: Science and Technology, 4(4), 045059. https://doi.org/10.1088/2632-2153/ad1436

Joshi, S., Mahanthi, B. L., G, P., Pokkuluri, K. S., Ninawe, S. S., & Sahu, R. (2025). Integrating LSTM and CNN for Stock Market Prediction: A Dynamic Machine Learning Approach. Journal of Artificial Intelligence and Technology. https://doi.org/10.37965/jait.2025.0652

Laxmi Narayan, M. D., & Balaji, N. (2025). Stock Opening Price Prediction Using RNN and LSTM. In H. Sharma, A. Chakravorty, S. Hussain, & R. Kumari (Eds.), Artificial Intelligence: Theory and Applications (Vol. 5589, pp. 363–376). Springer Nature Singapore. https://doi.org/10.1007/978-981-96-1687-9_25

Lu, W., Li, J., Li, Y., Sun, A., & Wang, J. (2020). A CNN-LSTM-Based Model to Forecast Stock Prices. Complexity, 2020, 1–10. https://doi.org/10.1155/2020/6622927

Mane, V., Patil, R., Pawar, S., Pujari, N., Jaggi, A., & Kakkar, P. (2025). Time Series Forecasting of Stock Prices Using Neural Networks LSTM and GAN. 2025 1st International Conference on AIML-Applications for Engineering & Technology (ICAET), 1–5. https://doi.org/10.1109/ICAET63349.2025.10932260

Marisetty, N. (2024). Prediction of Popular Global Stock Indexes Volatility by Using ARCH/GARCH Models. SSRN. https://doi.org/10.2139/ssrn.4904475

Mezghani, T., & Abbes, M. B. (2023). Forecast the Role of GCC Financial Stress on Oil Market and GCC Financial Markets Using Convolutional Neural Networks. Asia-Pacific Financial Markets, 30(3), 505–530. https://doi.org/10.1007/s10690-022-09387-3

Noh, S.-H. (2021). Analysis of Gradient Vanishing of RNNs and Performance Comparison. Information, 12(11), 442. https://doi.org/10.3390/info12110442

Shah, J., Vaidya, D., & Shah, M. (2022). A comprehensive review on multiple hybrid deep learning approaches for stock prediction. Intelligent Systems with Applications, 16, 200111. https://doi.org/10.1016/j.iswa.2022.200111

Srivastava, A., Srivastava, A., Singh, Y. B., & Misra, M. K. (2024). Deep Learning Models for Stock Market Forecasting: GARCH, ARIMA, CNN, LSTM, RNN. In A. Chaturvedi, S. U. Hasan, B. K. Roy, & B. Tsaban (Eds.), Cryptology and Network Security with Machine Learning (Vol. 918, pp. 827–839). Springer Nature Singapore. https://doi.org/10.1007/978-981-97-0641-9_56

Xiao, C., & Sun, J. (2021). Recurrent Neural Networks (RNN). In C. Xiao & J. Sun, Introduction to Deep Learning for Healthcare (pp. 111–135). Springer International Publishing. https://doi.org/10.1007/978-3-030-82184-5_7

Zhao, Q., Hao, Y., & Li, X. (2024). Stock price prediction based on hybrid CNN-LSTM model. Applied and Computational Engineering, 104(1), 110–115. https://doi.org/10.54254/2755-2721/104/20241065

Downloads

Published

2025-09-29

How to Cite

Joddy, S. (2025). Comparative Analysis of CNN, LSTM, and CNN–LSTM for Indonesian Stock Prediction. Engineering, MAthematics and Computer Science Journal (EMACS), 7(3), 283–289. https://doi.org/10.21512/emacsjournal.v7i3.14326
Abstract 6  .
PDF downloaded 5  .