Forecasting Stock Returns Using Long Short-Term Memory (LSTM) Model Based on Inflation Data and Historical Stock Price Movements

Keywords: forecasting, inflation, long short-term memory, stock forecasting, stock return

Abstract

The stock market is crucial for economic growth and development, offering profit opportunities that attract investors worldwide. However, its inherent volatility necessitates the inclusion of macroeconomic indicators like inflation, which can affect stock valuation and investor behavior. This study explores predicting stock returns using a Long Short-Term Memory (LSTM) model by incorporating inflation data, historical stock price movements, and calculated returns as input features. The dataset was split into 80% for training and 20% for testing, with hyperparameter tuning conducted using the RMSprop optimizer under varying batch sizes and epoch settings. Experimental results show that the configuration using RMSprop with a batch size of 8 and 200 epochs delivered the best performance, achieving a Root Mean Squared Error (RMSE) of 0.0167 and a Mean Absolute Percentage Error (MAPE) of 25.89%. These results represent a significant improvement over alternative configurations and previous benchmarks. This study underscores the importance of including inflation as a predictive variable, enhancing the model's accuracy. The findings highlight the relevance of incorporating macroeconomic factors into stock return forecasting, providing valuable insights for investors and financial analysts seeking data-driven strategies in decision-making processes.

Downloads

Download data is not yet available.

References

S. N. H.N, M. Mariah, and Y. Nur, “Analisis Indikator Makro Terhadap Nilai Saham Sektor Perbankan LQ45 di Bursa Efek Indonesia,” J. Manuver Akunt. dan Manaj., vol. 1, no. 2 SE-Articles, pp. 212–226, Jun. 2023, [Online]. Available: https://e-jurnal.nobel.ac.id/index.php/manuver/article/view/3948

T. Sulastri and D. Suselo, “Pengaruh Inflasi, Suku Bunga Dan Nilai Tukar Terhadap Harga Saham PT. Telekomunikasi Indonesia Tbk.,” JPEKA J. Pendidik. Ekon. Manaj. dan Keuang., vol. 6, no. 1 SE-Articles, pp. 29–40, May 2022, doi: 10.26740/jpeka.v6n1.p29-40.

F. Hasibuan, A. Soemitra, and R. Harahap, “Pengaruh Inflasi, Nilai Tukar, Harga Minyak Dunia Dan Harga Emas Dunia Terhadap Indeks Saham Syariah Indonesia,” J. Manaj. Akunt., vol. 3, pp. 211–221, Jan. 2023, doi: 10.36987/jumsi.v3i1.3983.

N. M. A. Dwijayanti, “Pengaruh Nilai Tukar dan Inflasi Terhadap Harga Saham Perbankan Pada Masa Pandemi COVID-19,” J. Bisnis dan Kewirausahaan, vol. 17, no. 1, pp. 86–93, 2021, doi: 10.31940/jbk.v17i1.2351.

S. Atu Rohmah, M. Michellita, T. W. Permatasari, and I. Safrudin, “Pengaruh Inflasi, Return on Asset , dan Return on Equity Terhadap Keputusan Investasi Saham Pada Perusahaan Manufaktur Yang Terdaftar di BEI,” J. Ekon. Bisnis Antart., vol. 2, no. 2, pp. 94–98, Jul. 2024, doi: 10.70052/jeba.v2i2.321.

C. Chikwira and J. I. Mohammed, “The Impact of the Stock Market on Liquidity and Economic Growth: Evidence of Volatile Market,” Economies, vol. 11, no. 6. 2023. doi: 10.3390/economies11060155.

M. Zulfani and A. Dapadeda, “Prediksi Harga Saham Menggunakan Algoritma Neural Network,” J. Teknol. Inf. J. Keilmuan dan Apl. Bid. Tek. Inform., vol. 18, no. 1, pp. 1–6, 2024, doi: https://doi.org/10.47111/jti.v18i1.11303.

B. Jange, “Prediksi Harga Saham Bank BCA Menggunakan XGBoost,” Arbitr. J. Econ. Account., vol. 3, no. 2, pp. 231–237, Nov. 2022, doi: https://doi.org/10.47065/arbitrase.v3i2.495.

V. P. Damartya, “Optimasi Portofolio Saham LQ45 dengan Mempertimbangkan Prediksi Return Menggunakan Metode Support Vector Regression (SVR),” Universitas Telkom, 2021. [Online]. Available: https://repository.telkomuniversity.ac.id/home/catalog/id/172428/slug/optimasi-portofolio-saham-lq45-dengan-mempertimbangkan-prediksi-return-menggunakan-metode-support-vector-regression-svr-.html

M. F. Rizkilloh and S. Widiyanesti, “Prediksi Harga Cryptocurrency Menggunakan Algoritma Long Short Term Memory (LSTM),” J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 6, no. 1 SE-Information Systems Engineering Articles, pp. 25–31, Feb. 2022, doi: 10.29207/resti.v6i1.3630.

E. S. Nugraha, Z. Alika, and D. A. Hamzah, “Forecasting the Stock Price of PT Astra International Using the LSTM Method,” J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 8, no. 3 SE-Information Technology Articles, pp. 431–437, Jun. 2024, doi: 10.29207/resti.v8i3.5699.

N. Afrianto, D. H. Fudholi, and S. Rani, “Prediksi Harga Saham Menggunakan BiLSTM dengan Faktor Sentimen Publik,” J. RESTI (Rekayasa Sist. dan Teknol. Informasi), vol. 6, no. 1 SE-Information Technology Articles, pp. 41–46, Feb. 2022, doi: 10.29207/resti.v6i1.3676.

D. Saputro and D. Swanjaya, “Analisa Prediksi Harga Saham Menggunakan Neural Network Dan Net Foreign Flow,” Gener. J., vol. 7, no. 2, pp. 96–104, 2023, doi: https://doi.org/10.29407/gj.v7i2.20001.

A. Arfan and L. ETP, “Perbandingan Algoritma Long Short-Term Memory dengan SVR Pada Prediksi Harga Saham di Indonesia,” PETIR, vol. 13, no. 1 SE-Articles, pp. 33–43, Mar. 2020, doi: 10.33322/petir.v13i1.858.

Brama Hendra Mahendra, M. G. Gumay, and L. C. Mungaran, “Analisis Perbandingan Prediksi Harga Saham menggunakan Algoritma Artificial Neural Network dan Linear Regression,” J. Ilm. Komputasi, vol. 22, no. 2 SE-Sistem Informasi, pp. 303–312, Jun. 2023, doi: 10.32409/jikstik.22.2.3357.

L. Wang and R. S. T. Lee, “Stock Index Return Volatility Forecast via Excitatory and Inhibitory Neuronal Synapse Unit with Modified MF-ADCCA,” Fractal and Fractional, vol. 7, no. 4. p. 292, 2023. doi: 10.3390/fractalfract7040292.

E. Simanungkalit, “Pengaruh Inflasi Terhadap Pertumbuhan Ekonomi Di Indonesia,” J. Manag. Small Mediu. Enterp., vol. 13, no. 3, pp. 327–340, Dec. 2020, doi: 10.35508/jom.v13i3.3311.

T. L. Situngkir and R. L. Batu, “Pengaruh Inflasi Dan Nilai Tukar Terhadap Indeks Harga Saham LQ45,” Sentralisasi, vol. 9, no. 1, pp. 36–44, Jan. 2020, doi: 10.33506/sl.v9i1.708.

J. Cao, S. Titman, X. Zhan, and W. Zhang, “ESG Preference, Institutional Trading, and Stock Return Patterns,” J. Financ. Quant. Anal., vol. 58, no. 5, pp. 1843–1877, 2023, doi: 10.1017/S0022109022000916.

F. Sausan, L. Korawijayanti, and A. Ciptaningtias, “The Effect of Return on Asset (ROA), Debt to Equity Ratio (DER), Earning per Share (EPS), Total Asset Turnover (TATO) and Exchange Rate on Stock Return of Property and Real Estate Companies at Indonesia Stock Exchange Period 2012-2017,” Ilomata Int. J. Tax Account., vol. 1, pp. 103–114, Mar. 2020, doi: 10.52728/ijtc.v1i2.66.

H. Hesniati, F. Fernado, S. Feblicia, C. Cerina, and A. Angela, “Analisis Pengaruh Inflasi, Suku Bunga dan Nilai Tukar Dollar terhadap Indeks Harga Saham LQ45,” J. Sos. dan Sains, vol. 2, no. 5, pp. 563–571, 2022, doi: 10.36418/sosains.v2i5.391.

F. Fathori, “Peran Pasar Modal Dalam Pembangunan Ekonomi: Studi Kasus Tentang Kontribusi Pasar Saham Terhadap Pertumbuhan Ekonomi di Negara Berkembang,” Curr. J. Ekon. dan Perbank. Syariah, vol. 2, no. 1, pp. 233–242, Oct. 2023, doi: 10.32806/syfdep0914.

R. Zapar, D. Pratama, K. Kaslani, C. L. Rohmat, and F. Faturrohman, “Penerapan Model Regresi Linier Untuk Prediksi Harga Saham Bank BCA Pada Bursa Efek Indonesia,” JATI J. Mhs. Tek. Inform., vol. 8, no. 1, pp. 196–202, 2024, doi: https://doi.org/10.36040/jati.v8i1.8215.

F. D. Adhinata and D. P. Rakhmadani, “Prediction of Covid-19 Daily Case in Indonesia Using Long Short Term Memory Method,” Teknika, vol. 10, no. 1, pp. 62–67, 2021, doi: 10.34148/teknika.v10i1.328.

Published
2025-05-24
How to Cite
Prasetyo, N. F., Witanti, W., & Hadiana, A. I. (2025). Forecasting Stock Returns Using Long Short-Term Memory (LSTM) Model Based on Inflation Data and Historical Stock Price Movements. Jurnal RESTI (Rekayasa Sistem Dan Teknologi Informasi), 9(3), 203 - 214. https://doi.org/10.29207/resti.v9i3.6422
Section
Information Technology Articles