Optimizing Indonesian Banking Stock Predictions with DBSCAN and LSTM
DOI:
https://doi.org/10.52436/1.jutif.2025.6.3.4439Keywords:
Anomaly, Banking, DBSCAN, LSTM, Outlier, StockAbstract
Investing in the stock market is challenged by high volatility, which often leads to inaccurate price predictions. Prediction models often struggle to handle the fluctuation phenomenon and produce unstable forecasts. This study aims to predict stock prices in three banks, namely PT Bank Central Asia Tbk (BBCA), PT Bank Rakyat Indonesia (Persero) Tbk (BBRI), and PT Bank Mandiri (Persero) Tbk (BMRI) using Long Short-Term Memory (LSTM) with the integration of Density-Based Spatial Clustering of Applications with Noise (DBSCAN) for anomaly detection. DBSCAN is applied with an epsilon (ε) of 0.5 and a minimum of 5 samples using Euclidean distance. The LSTM model consists of two hidden layers with 50 units, optimized using Adam, and applying the Mean Squared Error (MSE) loss function. The results show that DBSCAN improves prediction accuracy under several conditions. For BBCA stock, the lowest MSE was 0.003 at the 2nd fold with DBSCAN compared to 0.006 without DBSCAN. For BMRI stock achieved an MSE of 0.003 at the 4th fold with DBSCAN, while the 5th fold without DBSCAN obtained 0.000. For BBRI stock showed the best MSE of 0.003 at the 2nd fold with DBSCAN and the 5th fold without DBSCAN. These results show that the integration of DBSCAN can improve prediction especially when extreme price fluctuations occur. This research contributes to the development of stock price prediction methods that can be one of the benchmarks for investors before making decisions so that they do not experience losses.
Downloads
References
D. Tambunan, “Investasi Saham di Masa Pandemi COVID-19,” Widya Cipta J. Sekr. dan Manaj., vol. 4, no. 2, pp. 117–123, 2020.
T. Febiyola, R. S. Utari, B. T. Panggabean, and R. Agustina, “Analisis Surat Berharga Sebagai Alat Investasi,” Publ. Ilmu Huk., vol. 2, no. 3, pp. 75–86, 2024.
M. Azizah, M. I. Irawan, and E. R. M. Putri, “Comparison of stock price prediction using geometric Brownian motion and multilayer perceptron,” AIP Conf. Proc., vol. 2242, no. April, 2020.
W. C. Utomo, “Prediksi Pergerakan Saham BBRI ditengah Issue Ancaman Resesi 2023 dengan Pendekatan Machine Learning,” J. Teknol. dan Manaj. Inform., vol. 9, no. 1, pp. 20–27, 2023.
S. Dwi Ceysa, J. Demar Putri, D. A. Putri, and F. Siswajanthy, “Peranan Perbankan dalam Perekonomian Indonesia,” vol. 8, pp. 25959–25964, 2024.
W. Budiharto, “Data science approach to stock prices forecasting in Indonesia during Covid-19 using Long Short-Term Memory (LSTM),” J. Big Data, vol. 8, no. 1, 2021.
R. S. Lorenza, R. Octavia, S. Shafitranata, and A. W. Madyoningrum, “Dampak Covid 19 Terhadap Perubahan Harga Saham Perbankan di Indonesia Sebelum dan Saat Pandemi,” J. Akuntansi, Keuangan, dan Manaj., vol. 4, no. 1, pp. 43–56, 2022.
A. M. Priyatno, L. S. Tanjung, W. F. Ramadhan, P. Cholidhazia, P. Z. Jati, and F. I. Firmananda, “Comparison Random Forest Regression and Linear Regression For Forecasting BBCA Stock Price,” J. Tek. Ind. Terintegrasi, vol. 6, no. 3, pp. 718–732, 2023.
Bursa Efek Indonesia, “50 Biggest Market Capitalization - Juli 2024,” 2024. [Online]. Available: https://idx.co.id/id/data-pasar/laporan-statistik/digital-statistic/monthly/biggest-market-capitalization-most-active-stocks/biggest-market-capitalization?filter=eyJ5ZWFyIjoiMjAyMyIsIm1vbnRoIjoiMyIsInF1YXJ0ZXIiOjAsInR5cGUiOiJtb250aGx5In0%3D.
P. R. Sihombing, S. Suryadiningrat, D. A. Sunarjo, and Y. P. A. C. Yuda, “Identifikasi Data Outlier (Pencilan) dan Kenormalan Data Pada Data Univariat serta Alternatif Penyelesaiannya,” J. Ekon. Dan Stat. Indones., vol. 2, no. 3, pp. 307–316, 2023.
K. Choi, J. Yi, C. Park, and S. Yoon, “Deep Learning for Anomaly Detection in Time-Series Data: Review, Analysis, and Guidelines,” IEEE Access, vol. 9, pp. 120043–120065, 2021.
T. Bank, “Jurnal Teknologi Terpadu DIFFERENTIAL EVOLUTION UNTUK DETEKSI ANOMALI PADA DATA,” vol. 10, no. 1, pp. 22–31, 2024.
N. Nasution and F. Rakhmawati, “Segmentasi Pengguna E-Wallet Dengan Menggunakan Metode Dbscan (Density Based Spatial Clustering Application With Noise) Di Kota Medan,” J. Lebesgue J. Ilm. Pendidik. Mat. Mat. dan Stat., vol. 4, no. 2, pp. 1386–1392, 2023.
P. O. C. Sari and S. Suharjito, “Outlier Detection in Inpatient Claims Using DBSCAN and K-Means,” J. Tek. Inform., vol. 15, no. 1, pp. 1–10, 2022.
Y. Syawali, M. Haikal, H. Rangkuti, and K. A. Mayadi, “PENERAPAN ALGORITMA DBSCAN UNTUK ANALISIS DEMOGRAFIS dan PENGELUARAN PELANGGAN MALL.”
D. Armiady, “Analisis Metode DBSCAN (Density-Based Spatial Clustering of Application with Noise) dalam Mendeteksi Data Outlier,” JURIKOM (Jurnal Ris. Komputer), vol. 9, no. 6, p. 2158, 2022.
R. Saputra et al., “ANALISIS PREDIKSI SAHAM TESLA MENGGUNAKAN ALGORITMA LONG SHORT TERM MEMORY ( LSTM ),” vol. 2, no. 1, pp. 81–90, 2024.
V. Arinal and M. Puspita, “Peningkatan Akurasi Nilai Harga Saham Menggunakan Metode Long Short-Term Memory ( LSTM ) pada PT Unilever Abstrak,” vol. 6, no. 1, pp. 252–260, 2025.
R. F. Inaku and J. C. Chandra, “Implementasi Data Mining Dalam Prediksi Harga Saham Menggunakan Metode Long Short Term Memory (Lstm),” J. Ticom Technol. Inf. Commun., vol. 12, no. 1, pp. 1–7, 2023.
R. Luthfiansyah and B. Wasito, “Penerapan Teknik Deep Learning (Long Short Term Memory) dan Pendekatan Klasik (Regresi Linier) dalam Prediksi Pergerakan Saham BRI,” J. Inform. dan Bisnis, vol. 12, no. 2, pp. 42–54, 2023.
R. Julian and M. R. Pribadi, “Peramalan Harga Saham Pertambangan Pada Bursa Efek Indonesia (BEI) Menggunakan Long Short Term Memory (LSTM),” JATISI (Jurnal Tek. Inform. dan Sist. Informasi), vol. 8, no. 3, pp. 1570–1580, 2021.
E. A. Fadlilah, “Identifikasi Anomali Data Akademik Menggunakan Dbscan Outlier Detection,” Pros. Sains Nas. dan Teknol., vol. 12, no. 1, p. 336, 2022.
A. Primawati, I. S. Sitanggang, A. Annisa, and D. A. Astuti, “Perbandingan Kinerja LSTM dan Prophet untuk Prediksi Deret Waktu (Studi Kasus Produksi Susu Sapi Harian),” J. Edukasi dan Penelit. Inform., vol. 9, no. 3, p. 428, 2023.
A. S. B. Karno, “Prediksi Data Time Series Saham Bank BRI Dengan Mesin Belajar LSTM (Long ShortTerm Memory),” J. Inform. Inf. Secur., vol. 1, no. 1, pp. 1–8, 2020.
W. Hastomo, A. S. B. Karno, N. Kalbuana, E. Nisfiani, and L. ETP, “Optimasi Deep Learning untuk Prediksi Saham di Masa Pandemi Covid-19,” … (Jurnal Edukasi dan …, vol. 7, no. 2, pp. 133–140, 2021.
Bursa Efek Indonesia, “Indeks Saham.” [Online]. Available: https://www.idx.co.id/id/data-pasar/data-saham/indeks-saham.
N. P. A. Widiari, I. M. A. D. Suarjaya, and D. P. Githa, “Teknik Data Cleaning Menggunakan Snowflake untuk Studi Kasus Objek Pariwisata di Bali,” J. Ilm. Merpati (Menara Penelit. Akad. Teknol. Informasi), vol. 8, no. 2, p. 137, 2020.
M. R. A. Prasetya, A. M. Priyatno, and Nurhaeni, “Penanganan Imputasi Missing Values pada Data Time Series dengan Menggunakan Metode Data Mining,” J. Inf. dan Teknol., vol. 5, no. 2, pp. 52–62, 2023.
Z. Efendy, “Normalisasi dalam Desain Database,” J. CoreIT, vol. 4, no. 1, pp. 34–43, 2018.
P. J. Muhammad Ali, “Investigating the Impact of Min-Max Data Normalization on the Regression Performance of K-Nearest Neighbor with Different Similarity Measurements,” Aro-the Sci. J. Koya Univ., vol. 10, no. 1, pp. 85–91, 2022.
I. D. Id, A. Astrid, and E. Mahdiyah, “Modifikasi DBSCAN (Density-Based Spatial Clustering With Noise) pada Objek 3 Dimensi,” J. Komput. Terap., vol. 3, no. 1, pp. 41–52, 2017.
F. Izhari, “Analisis Algoritma Dbscan Dalam Menentukan Parameter Epsilon Pada Clustering Data Numerik,” Semin. Nas. Teknol. Komput. Sains, pp. 156–158, 2020.
M. A. Maliki, I. Cholissodin, and N. Yudistira, “Prediksi Pergerakan Harga Cryptocurrency Bitcoin terhadap Mata Uang Rupiah menggunakan Algoritme LSTM,” J. Pengemb. Teknol. Inf. dan Ilmu Komput., vol. 6, no. 7, pp. 3259–3268, 2022.
J. Asbullah and S. Samsudin, “Prediksi Harga Cryptocurrency Binance Berdasarkan Informasi Blokchain dengan Menggunakan Algoritma Random Forest,” J. Media Inform. Budidarma, vol. 8, no. 1, p. 260, 2024.
D. R. Chandranegara, R. A. Afif, C. S. K. Aditya, W. Suharso, and H. Wibowo, “Prediksi Harga Saham Jakarta Islamic Index Menggunakan Metode Long Short-Term Memory,” J. Edukasi dan Penelit. Inform., vol. 9, no. 1, p. 129, 2023.
A. Rosenblad, The Concise Encyclopedia of Statistics, vol. 38, no. 4. 2011.
Additional Files
Published
How to Cite
Issue
Section
License
Copyright (c) 2025 Septiannisa Alya Shinta Purwandhani, Aletta Agigia Novta Sajiatmoko, Christian Sri Kusuma Aditya

This work is licensed under a Creative Commons Attribution 4.0 International License.