Main Article Content

Abstract

Stocks are capital market instruments capable of creating profits for investors. However, stocks have a fluctuating nature that can lead to risk, so price predictions are needed to reduce this risk. Stock price prediction can use various methods such as deep learning. This study aims to predict stock price using Convolution Neural Network (CNN) and Long Short Term Memory (LSTM), with the application carried out at the stock price of Bank Central Asia (BBCA) for the period between July 1, 2005 and December 30, 2022. Data division uses a ratio of 70% for training and 30% for testing. To maximize prediction results, we select the best hyperparameter combinations using Grid Search. The prediction results show that CNN is better to LSTM, where CNN produces RMSE values of 488.992, R2 83.8%, and MAPE 6.5%.

Keywords

CNN deep learning grid search LSTM stock price

Article Details

How to Cite
Pangestika, Z., & Josaphat, B. P. (2025). Predicting Stock Price Using Convolutional Neural Network and Long Short Term Memory (Case Study: Stock of BBCA). Journal of the Indonesian Mathematical Society, 31(1), 1512. https://doi.org/10.22342/jims.v31i1.1512

References

  1. A. B. Untoro, “Prediksi harga saham dengan menggunakan jaringan syaraf tiruan,” Jurnal Teknologi Informatika Dan Komputer, vol. 6, no. 2, pp. 103–111, 2020. https://doi.org/10.37012/jtik.v6i2.212.
  2. A. Fitriadini, “Penerapan backpropagation neural network dalam prediksi harga saham,” in Prosiding Seminar Nasional Mahasiswa Bidang Ilmu Komputer dan Aplikasinya, vol. 1, pp. 561–573, 2020. https://conference.upnvj.ac.id/index.php/senamika/article/view/627/0.
  3. G. Bathla, “Stock price prediction using lstm and svr,” in 2020 Sixth International Conference on Parallel, Distributed and Grid Computing (PDGC), pp. 211–214, IEEE, 2020. https://doi.org/10.1109/PDGC50313.2020.9315800.
  4. S. Wadi, M. Almasarweh, A. A. Alsaraireh, and J. Aqaba, “Predicting closed price time series data using arima model,” Modern Applied Science, vol. 12, no. 11, pp. 181–185, 2018. https://doi.org/10.5539/mas.v12n11p181.
  5. G. P. Zhang, “Time series forecasting using a hybrid arima and neural network model,” Neurocomputing, vol. 50, pp. 159–175, 2003. https://doi.org/10.1016/S0925-2312(01) 00702-0.
  6. Y. Kara, M. A. Boyacioglu, and ¨O. K. Baykan, “Predicting direction of stock price index movement using artificial neural networks and support vector machines: The sample of the istanbul stock exchange,” Expert systems with Applications, vol. 38, no. 5, pp. 5311–5319, 2011. https://doi.org/10.1016/j.eswa.2010.10.027.
  7. E. I. Ardyanta and S. Hasrini, “A prediction of stock price movements using support vector machines in indonesia,” The Journal of Asian Finance, Economics and Business (JAFEB), vol. 8, no. 8, pp. 399–407, 2021. https://doi.org/10.13106/jafeb.2021.vol8.no8.0399.
  8. B. Jange, “Prediksi harga saham bank bca menggunakan xgboost,” ARBITRASE: Journal of Economics and Accounting, vol. 3, no. 2, pp. 231–237, 2022. https://doi.org/10.47065/arbitrase.v3i2.495.
  9. J. Kordonis, S. Symeonidis, and A. Arampatzis, “Stock price forecasting via sentiment analysis on twitter,” pp. 1–6, 2016. https://doi.org/10.1145/3003733.3003787.
  10. L. Deng, D. Yu, et al., “Deep learning: methods and applications,” Foundations and trends® in signal processing, vol. 7, no. 3–4, pp. 197–387, 2014. https://doi.org/10.1561/2000000039.
  11. S. Lahmiri and S. Bekiros, “Cryptocurrency forecasting with deep learning chaotic neural networks,” Chaos, Solitons & Fractals, vol. 118, pp. 35–40, 2019. https://doi.org/10.1016/j.chaos.2018.11.014.
  12. I. O. Arissinta, I. D. Sulistiyawati, D. Kurnianto, and I. Kharisudin, “Pemodelan time series untuk peramalan web traffic menggunakan algoritma arima, lstm, dan gru,” in PRISMA, Prosiding Seminar Nasional Matematika, vol. 5, pp. 693–700, 2022. https://journal.unnes.ac.id/sju/prisma/article/view/54712.
  13. Y. Sun, Y. Liang, W. Zhang, H. Lee, W. Lin, and L. Cao, “Optimal partition algorithm of the rbf neural network and its application to financial time series forecasting,” Neural Computing & Applications, vol. 14, pp. 36–44, 2005. https://doi.org/10.1007/s00521-004-0439-7.
  14. S. Chen and H. He, “Stock prediction using convolutional neural network,” in IOP Conference series: materials science and engineering, vol. 435, p. 012026, IOP Publishing, 2018. https://doi.org/10.1088/1757-899X/435/1/012026.
  15. L. Sayavong, Z. Wu, and S. Chalita, “Research on stock price prediction method based on convolutional neural network,” in 2019 international conference on virtual reality and intelligent systems (ICVRIS), pp. 173–176, IEEE, 2019. https://doi.org/10.1109/ICVRIS.2019.00050.
  16. F. K. Putri and J. D. Tjahhjono, “Pengaruh analisis fundamental terhadap pergerakan harga saham,” Jurnal Bisnis Indonesia Vol, vol. 2, no. 1, 2011.
  17. D. T. O. Phety, “Pengaruh pemilihan presiden 21 mei 2019 terhadap abnormal return saham (studi kasus pada sektor perbankan yang listing di bei),” Jurnal Bisnis, Manajemen &Ekonomi, vol. 18, no. 2, pp. 304–314, 2020. https://journal.widyatama.ac.id/index.php/jbme/article/view/683.
  18. Bareksa, “Ini 4 faktor penekan saham perbankan,” 2018. Accessed: 2023-01-30.
  19. C. Indonesia, “Ihsg anjlok ditekan pelemahan saham perbankan,” IHSG Anjlok Ditekan Pelemahan Saham Perbankan/, 2016.
  20. IDX, “Index saham.” https://www.idx.co.id/id/data-pasar/data-saham/indeks-saham/, 2023. Accessed: 2023-01-28.
  21. B. E. Indonesia, “Pt bursa efek indonesia.” https://www.idx.co.id/id. Accessed: 2023-01-28.
  22. Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner, “Gradient-based learning applied to document recognition,” Proceedings of the IEEE, vol. 86, no. 11, pp. 2278–2324, 1998. https://doi.org/10.1109/5.726791.
  23. B. Kim and T.-G. Kim, “Cooperation of simulation and data model for performance analysis of complex systems,” International Journal of Simulation Modelling, vol. 18, no. 4, pp. 608–619, 2019. https://doi.org/10.2507/ijsimm18(4)491.
  24. M. Z. Alom, T. M. Taha, C. Yakopcic, S. Westberg, P. Sidike, M. S. Nasrin, B. C. Van Esesn, A. A. S. Awwal, and V. K. Asari, “The history began from alexnet: A comprehensive survey on deep learning approaches,” arXiv preprint arXiv:1803.01164, 2018. https://doi.org/10.48550/arXiv.1803.01164.
  25. M. R. Alwanda, R. P. K. Ramadhan, and D. Alamsyah, “Implementasi metode convolutional neural network menggunakan arsitektur lenet-5 untuk pengenalan doodle,” Jurnal Algoritme, vol. 1, no. 1, pp. 45–56, 2020. https://doi.org/10.35957/algoritme.v1i1.434.
  26. Suyanto, K. N. Ramadhani, and S. Mandala, “Deep learning modernisasi machine learning untuk big data,” Informatika, 2019.
  27. S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural computation, vol. 9, no. 8, pp. 1735–1780, 1997. https://doi.org/10.1162/neco.1997.9.8.1735.
  28. S. Zahara, Sugianto, and M. B. Ilmiddafiq, “Prediksi indeks harga konsumen menggunakan metode long short term memory (lstm) berbasis cloud computing,” Jurnal RESTI (Rekayasa Sistem Dan Teknologi Informasi), vol. 3, no. 3, pp. 357–363, 2019. https://doi.org/10.29207/resti.v3i3.1086.
  29. Y. Finance, “Yahoo finance - stock market live, quotes, business, & finance news.” https://finance.yahoo.com/, 2023. Accessed: 2023-02-12.
  30. N. Srivastava, G. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov, “Dropout: a simple way to prevent neural networks from overfitting,” The journal of machine learning research, vol. 15, no. 1, pp. 1929–1958, 2014. https://dl.acm.org/doi/abs/10.5555/2627435.2670313.
  31. J. Brownlee, Deep learning for time series forecasting: predict the future with MLPs, CNNs and LSTMs in Python. Machine Learning Mastery, 2018.
  32. N. Afrianto, D. H. Fudholi, and S. Rani, “Prediksi harga saham menggunakan bilstm dengan faktor sentimen publik,” Jurnal RESTI (Rekayasa Sistem Dan Teknologi Informasi), vol. 6, no. 1, pp. 41–46, 2022. https://doi.org/10.29207/resti.v6i1.3676.
  33. M. A. I. Sunny, M. M. S. Maswood, and A. G. Alharbi, “Deep learning-based stock price prediction using lstm and bi-directional lstm model,” in 2020 2nd novel intelligent and leading emerging sciences conference (NILES), pp. 87–92, IEEE, 2020. https://doi.org/10.1109/NILES50944.2020.9257950.
  34. G. Ranjan, A. K. Verma, and S. Radhika, “K-nearest neighbors and grid search cv based real time fault monitoring system for industries,” in 2019 IEEE 5th international conference for convergence in technology (I2CT), pp. 1–5, IEEE, 2019. https://doi.org/10.1109/I2CT45611.2019.9033691.
  35. BCA, “Tentang bca - kronologis pencatatan saham bca.” https://www.bca.co.id/id/tentang-bca/hubungan-investor/informasi-saham/kronologis-pencatatan-saham, 2023. Accessed: 2023-01-28.
  36. T. Putra Saham Perbankan Tumbang (Lagi), Waktunya Serok?, Sep 2020.
  37. W. Mensi, S. Hammoudeh, J. C. Reboredo, and D. K. Nguyen, “Do global factors impact brics stock markets? a quantile regression approach,” Emerging Markets Review, vol. 19, pp. 1–17, 2014. https://doi.org/10.1016/j.ememar.2014.04.002.
  38. T. S. Goh, H. Henry, and A. ALBERT, “Determinants and prediction of the stock market during covid-19: Evidence from indonesia,” The Journal of Asian Finance, Economics and Business, vol. 8, no. 1, pp. 1–6, 2021. https://doi.org/10.13106/jafeb.2021.vol8.no1.001.
  39. Y. Maurina, Pengaruh tingkat inflasi, kurs rupiah dan tingkat suku bunga BI rate terhadap IHSG (Studi pada bursa efek indonesia periode 2010-2014). PhD thesis, Brawijaya University, 2015.
  40. S. Wu, Y. Liu, Z. Zou, and T.-H. Weng, “S i lstm: stock price prediction based on multiple data sources and sentiment analysis,” Connection Science, vol. 34, no. 1, pp. 44–62, 2022. https://doi.org/10.1080/09540091.2021.1940101.
  41. E. L. Maretha and F. X. H. Prasetya, “Studi peristiwa masa awal pandemi covid-19 dan prediksi analisis teknikal saham perbankan indonesia,” Jurnal Pasar Modal dan Bisnis, vol. 3, no. 1, pp. 159–174, 2021. https://doi.org/10.37194/jpmb.v3i1.81.
  42. Investing.com, “Usd idr historical data.” https://www.investing.com/currencies/usd-idr-historical-data, 2023. Accessed: 2023-02-12.
  43. B. Indonesia, “Interest rates - bank indonesia.” https://www.bi.go.id/id/statistik/sdds/Default.aspx?id_file=14-010, 2023. Accessed: 2023-02-12.
  44. S. T. Mndawe, B. S. Paul, and W. Doorsamy, “Development of a stock price prediction framework for intelligent media and technical analysis,” Applied Sciences, vol. 12, no. 2, p. 719, 2022. https://doi.org/10.3390/app12020719.
  45. E. Ong, Technical Analysis For Mega Profit (Hc). Gramedia Pustaka Utama, 2016.
  46. A. Chen, Predictive modeling of webpage aesthetics. Missouri University of Science and Technology, 2019.
  47. T. Boulmaiz, M. Guermoui, and H. Boutaghane, “Impact of training data size on the lstm performances for rainfall–runoff modeling,” Modeling Earth Systems and Environment, vol. 6, pp. 2153–2164, 2020. https://doi.org/10.1007/s40808-020-00830-w.
  48. M. Feurer and F. Hutter, “Hyperparameter optimization,” Automated machine learning: Methods, systems, challenges, pp. 3–33, 2019.
  49. W. Li, W. W. Ng, T. Wang, M. Pelillo, and S. Kwong, “Help: An lstm-based approach to hyperparameter exploration in neural network learning,” Neurocomputing, vol. 442, pp. 161–172, 2021. https://doi.org/10.1016/j.neucom.2020.12.133.