Implementasi Model Long Short Term Memory (LSTM) dalam Prediksi Harga Saham
Abstract
Stock market investment is gaining popularity, although predicting stock price fluctuations remains challenging. Accurate stock prediction models can assist investors in decision-making. In this research, a Long Short-Term Memory (LSTM) model was employed to make predictions regarding the stock prices of BBCA based on daily historical data from January 1 2015 to January 1 2025. The data was gathered from the Yahoo Finance website, utilizing only the closing price ('close') variable. The research process included data pre-processing, Min-Max normalization, LSTM modeling with varying timesteps (30, 60, 90 days), and evaluation of prediction results. The LSTM model was built with two LSTM layers, a dropout layer, and a final dense layer, and its training involved the application of the mean_squared_error loss function and Adam optimizer. Evaluation results showed that the model configuration with 60 timesteps achieved optimal performance with a RMSE of 114.17, MAPE percentage of 0.96%, and an R-Squared of 0.98, indicating highly accurate and reliable predictions. This study demonstrated that LSTM is an effective model for stock price prediction based on time series data.
References
E. O. Gultom and M. I. Irawan, “Prediksi Harga Saham Jangka Pendek di Indonesia Menggunakan Metode Gaussian Process Regression,” Jurnal Sains dan Seni ITS, vol. 11, no. 2, 2022, doi: 10.12962/j23373520.v11i2.76914.
Pratama Putu Agus Narestha Adi and Saepudin Deni, “Peramalan Return Saham pada IDX30 Menggunakan Economic Constraint Model dan Technical Indicators,” 2022. Accessed: Dec. 30, 2024. [Online]. Available: https://openlibrarypublications.telkomuniversity.ac.id/index.php/engineering/article/view/21361
A. Arfan and dan Lussiana ETP, “Prediksi Harga Saham Di Indonesia Menggunakan Algoritma Long Short-Term Memory,” Universitas Gunadarma Jl. Margonda Raya No, vol. 3, no. 1, 2019, [Online]. Available: https://www.ofx.com
S. Maddodi and K. G. N. Kumar, “Stock Market Forecasting: a Review of Literature,” IJCSNS International Journal of Computer Science and Network Security, vol. Vol 5, No, 2021.
P. T. Yamak, L. Yujian, and P. K. Gadosey, “A comparison between ARIMA, LSTM, and GRU for time series forecasting,” in ACM International Conference Proceeding Series, 2019. doi: 10.1145/3377713.3377722.
“Implementasi Long Short-Term Memory Pada Prediksi Harga Saham PT Aneka Tambang Tbk,” Jurnal Ilmiah Komputasi, vol. 21, no. 1, 2022, doi: 10.32409/jikstik.21.1.2815.
L. Wiranda and M. Sadikin, “Penerapan Long Short Term Memory pada Data Time Series untuk Memprediksi Penjualan Produk PT. Metiska Farma,” Jurnal Nasional Pendidikan Teknik Informatika (JANAPATI), vol. 8, no. 3, pp. 184–196, 2019.
Haoran Wu, Shuqi Chen, and Yicheng Ding, “Comparison of ARIMA and LSTM for Stock Price Prediction,” Financial Engineering and Risk Management, vol. 6, no. 1, 2023, doi: 10.23977/ferm.2023.060101.
R. Julian and M. R. Pribadi, “Peramalan Harga Saham Pertambangan Pada Bursa Efek Indonesia (BEI) Menggunakan Long Short Term Memory (LSTM),” JATISI (Jurnal Teknik Informatika dan Sistem Informasi), vol. 8, no. 3, 2021, doi: 10.35957/jatisi.v8i3.1159.
Moh. Wigi Destriansyah and D. A. N. Sirodj, “Analisis Hubungan Harga Saham Bank Central Asia, Inflasi, Kurs (IDR/USD) dan BI Rate dengan Metode Vector Error Correction Model (VECM),” Bandung Conference Series: Statistics, vol. 2, no. 2, 2022, doi: 10.29313/bcss.v2i2.4057.
N. Selle, N. Yudistira, and C. Dewi, “Perbandingan Prediksi Penggunaan Listrik dengan Menggunakan Metode Long Short Term Memory (LSTM) dan Recurrent Neural Network (RNN),” Jurnal Teknologi Informasi dan Ilmu Komputer, vol. 9, no. 1, 2022, doi: 10.25126/jtiik.2022915585.
M. Q. Andiyantama, I. Zahira, and A. Irawan, “Prediksi Energi Listrik Kincir Angin Berdasarkan Data Kecepatan Angin Menggunakan LSTM,” JITCE (Journal of Information Technology and Computer Engineering), vol. 5, no. 01, 2021, doi: 10.25077/jitce.5.01.1-7.2021.
S. Zahara, Sugianto, and M. Bahril 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, 2019, doi: 10.29207/resti.v3i3.1086.
H. N. Bhandari, B. Rimal, N. R. Pokhrel, R. Rimal, K. R. Dahal, and R. K. C. Khatri, “Predicting stock market index using LSTM,” Machine Learning with Applications, vol. 9, 2022, doi: 10.1016/j.mlwa.2022.100320.
B. K. Hidayatullah, M. Kallista, C. Setianingsih, P. S1, and T. Komputer, “Prediksi Indeks Standar Pencemar Udara Menggunakan Metode Long Short-Term Memory Berbasis Web (Studi Kasus Pada Kota Jakarta),” e-Proceeding of Engineering , vol. 9, no. 3, pp. 1247–1255, 2022, [Online]. Available: https://data.jakarta.go.id/
V. L. N. Komanapalli, N. Sivakumaran, and S. Hampannavar, Advances in Automation, Signal Processing, Instrumentation, and Control: Select Proceedings of i-CASIC 2020, vol. 700. 2021.
A. Rosyd, A. Irma Purnamasari, and I. Ali, “PENERAPAN METODE LONG SHORT TERM MEMORY (LSTM) DALAM MEMPREDIKSI HARGA SAHAM PT BANK CENTRAL ASIA,” 2024.
D. Ardiansyah, “PERBANDINGAN MODEL PREDIKSI RADIASI MATAHARI BERBASIS MESIN PEMBELAJARAN PADA STASIUN METEOROLOGI FATMAWATI SOEKARNO BENGKULU,” Megasains, vol. 14, no. 1, 2023, doi: 10.46824/megasains.v14i1.129.
D. A. Nasution, H. H. Khotimah, and N. Chamidah, “Perbandingan Normalisasi Data untuk Klasifikasi Wine Menggunakan Algoritma K-NN,” Computer Engineering, Science and System Journal, vol. 4, no. 1, 2019, doi: 10.24114/cess.v4i1.11458.
Copyright (c) 2025 Juliandi Kurniansyah, Siska Kurnia Gusti, Febi Yanto, Muhammad Affandes

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).


.png)
.png)


