Improving Stock Price Prediction Accuracy with StacBi LSTM


  • Mohammad Diqi Universitas Respati Yogyakarta
  • Hamzah Hamzah Universitas Respati Yogyakarta



Stock Price Prediction, Stacked Bidirectional LSTM, Time Series Analysis, Indonesian Stock Exchange, Input Sequence Length


This research aimed to enhance stock price prediction accuracy using the Stacked Bidirectional Long Short-Term Memory (StacBi LSTM) model. The study addressed the challenge of capturing long-term dependencies and temporal patterns inherent in stock price data. The research objectives were to evaluate the model's performance across different input sequence lengths and identify the optimal length for prediction. Leveraging a dataset from the Indonesian Stock Exchange, the model's predictions were evaluated using key metrics such as RMSE, MAE, MAPE, and R2. Results indicated that the StacBi LSTM model excelled in capturing stock price trends and demonstrated strengths over traditional methods. The optimal input sequence length was identified, balancing computational efficiency and prediction accuracy. This research contributes valuable insights into improving stock price prediction techniques and offers practical implications for traders and investors. Future research directions encompass hybrid models and integrating external factors to enhance predictive capabilities further.


Ahmad, I., Wang, X., Zhu, M., Wang, C., Pi, Y., Khan, J. A., Khan, S., Samuel, O. W., Chen, S., & Li, G. (2022). EEG-Based Epileptic Seizure Detection via Machine/Deep Learning Approaches: A Systematic Review. Computational Intelligence and Neuroscience, 2022, 1–20.

Aydin, M., Pata, U. K., & Inal, V. (2022). Economic policy uncertainty and stock prices in BRIC countries: evidence from asymmetric frequency domain causality approach. Applied Economic Analysis, 30(89), 114–129.

Baek, J.-W., & Chung, K. (2023). Multi-Context Mining-Based Graph Neural Network for Predicting Emerging Health Risks. IEEE Access, 11, 15153–15163.

Brahma, B., & Wadhvani, R. (2020). Solar Irradiance Forecasting Based on Deep Learning Methodologies and Multi-Site Data. Symmetry, 12(11), 1830.

Campbell, T., Dixon, K. W., Dods, K., Fearns, P., & Handcock, R. (2020). Machine Learning Regression Model for Predicting Honey Harvests. Agriculture, 10(4), 118.

Choi, J.-E., & Shin, D. W. (2019). The roles of differencing and dimension reduction in machine learning forecasting of employment level using the FRED big data. Communications for Statistical Applications and Methods, 26(5), 497–506.

Erizal, E., & Diqi, M. (2023). Performance Evaluation of Stock Prediction Models using EMAGRU. Applied Computer Science, 19(3), 160–173.

Fathy, Y., Jaber, M., & Brintrup, A. (2021). Learning With Imbalanced Data in Smart Manufacturing: A Comparative Analysis. IEEE Access, 9, 2734–2757.

Gao, Y., Lian, J., & Gong, B. (2018). Automatic classification of refrigerator using doubly convolutional neural network with jointly optimized classification loss and similarity loss. Eurasip Journal on Image and Video Processing, 2018(1), 1–11.

Gutmann, S., Maget, C., Spangler, M., & Bogenberger, K. (2021). Truck Parking Occupancy Prediction: XGBoost-LSTM Model Fusion. Frontiers in Future Transportation, 2, 693708.

Htun, H. H., Biehl, M., & Petkov, N. (2023). Survey of feature selection and extraction techniques for stock market prediction. Financial Innovation, 9(1), 1–25.

Jamous, R., ALRahhal, H., & El-Darieby, M. (2021). A New ANN-Particle Swarm Optimization with Center of Gravity (ANN-PSOCoG) Prediction Model for the Stock Market under the Effect of COVID-19. Scientific Programming, 2021, 1–17.

Jiang, H., Fang, D., Spicher, K., Cheng, F., & Li, B. (2019). A New Period-Sequential Index Forecasting Algorithm for Time Series Data. Applied Sciences, 9(20), 4386.

Kim, B., Yuvaraj, N., Sri Preethaa, K. R., Hu, G., & Lee, D.-E. (2021). Wind-Induced Pressure Prediction on Tall Buildings Using Generative Adversarial Imputation Network. Sensors, 21(7), 2515.

Lind, A. P., & Anderson, P. C. (2019). Predicting drug activity against cancer cells by random forest models based on minimal genomic information and chemical properties. PLOS ONE, 14(7), e0219774.

Lokanan, M. (2022). The determinants of investment fraud: A machine learning and artificial intelligence approach. Frontiers in Big Data, 5, 961039.

Ma, S.-C., Chou, W., Chien, T.-W., Chow, J. C., Yeh, Y.-T., Chou, P.-H., & Lee, H.-F. (2020). An App for Detecting Bullying of Nurses Using Convolutional Neural Networks and Web-Based Computerized Adaptive Testing: Development and Usability Study. JMIR MHealth and UHealth, 8(5), e16747.

Miftahurrohmah, B., Wulandari, C., & Dharmawan, Y. S. (2021). Investment Modelling Using Value at Risk Bayesian Mixture Modelling Approach and Backtesting to Assess Stock Risk. Journal of Information Systems Engineering and Business Intelligence, 7(1), 11.

Mo, S., Lu, P., & Liu, X. (2022). AI-Generated Face Image Identification with Different Color Space Channel Combinations. Sensors, 22(21), 8228.

Musarat, M. A., Alaloul, W. S., Rabbani, M. B. A., Ali, M., Altaf, M., Fediuk, R., Vatin, N., Klyuev, S., Bukhari, H., Sadiq, A., Rafiq, W., & Farooq, W. (2021). Kabul River Flow Prediction Using Automated ARIMA Forecasting: A Machine Learning Approach. Sustainability, 13(19), 10720.

Naumoski, A., Arsov, S., & Cvetkoska, V. (2022). Asymmetric Information and Agency Cost of Financial Leverage and Corporate Investments: Evidence from Emerging South-East European Countries. Scientific Annals of Economics and Business, 69(2), 317–342.

Pamir, Javaid, N., Akbar, M., Aldegheishem, A., Alrajeh, N., & Mohammed, E. A. (2022). Employing a Machine Learning Boosting Classifiers Based Stacking Ensemble Model for Detecting Non Technical Losses in Smart Grids. IEEE Access, 10, 121886–121899.

Pan, D., Zeng, A., Jia, L., Huang, Y., Frizzell, T., & Song, X. (2020). Early Detection of Alzheimer’s Disease Using Magnetic Resonance Imaging: A Novel Approach Combining Convolutional Neural Networks and Ensemble Learning. Frontiers in Neuroscience, 14, 501050.

Patel, R. K., Kumari, A., Tanwar, S., Hong, W.-C., & Sharma, R. (2022). AI-Empowered Recommender System for Renewable Energy Harvesting in Smart Grid System. IEEE Access, 10, 24316–24326.

Qaddoura, R., M. Al-Zoubi, A., Faris, H., & Almomani, I. (2021). A Multi-Layer Classification Approach for Intrusion Detection in IoT Networks Based on Deep Learning. Sensors, 21(9), 2987.

Rajamoorthy, R., Saraswathi, H. V., Devaraj, J., Kasinathan, P., Elavarasan, R. M., Arunachalam, G., Mostafa, T. M., & Mihet-Popa, L. (2022). A Hybrid Sailfish Whale Optimization and Deep Long Short-Term Memory (SWO-DLSTM) Model for Energy Efficient Autonomy in India by 2048. Sustainability, 14(3), 1355.

Sekiguchi, Hayashi, Sugino, & Terada. (2019). The Effects of Differences in Individual Characteristics and Regional Living Environments on the Motivation to Immigrate to Hometowns: A Decision Tree Analysis. Applied Sciences, 9(13), 2748.

Shuai, C., Pan, Z., Gao, L., & Zuo, H. (2021). Short-Term Traffic Flow Prediction of Expressway: A Hybrid Method Based on Singular Spectrum Analysis Decomposition. Advances in Civil Engineering, 2021, 1–10.

Succetti, F., Rosato, A., Di Luzio, F., Ceschini, A., & Panella, M. (2022). A Fast Deep Learning Technique for Wi-Fi-Based Human Activity Recognition. Progress In Electromagnetics Research, 174, 127–141.

Suleman, M. A. R., & Shridevi, S. (2022). Short-Term Weather Forecasting Using Spatial Feature Attention Based LSTM Model. IEEE Access, 10, 82456–82468.

Tang, L., & Mahmoud, Q. H. (2022). A Deep Learning-Based Framework for Phishing Website Detection. IEEE Access, 10, 1509–1521.

Wang, G., Cao, L., Zhao, H., Liu, Q., & Chen, E. (2021). Coupling Macro-Sector-Micro Financial Indicators for Learning Stock Representations with Less Uncertainty. Proceedings of the AAAI Conference on Artificial Intelligence, 35(5), 4418–4426.

Williams, R. I., Smith, A., Aaron, J. R., Manley, S. C., & McDowell, W. C. (2020). Small business strategic management practices and performance: A configurational approach. Economic Research-Ekonomska Istraživanja, 33(1), 2378–2396.

Zhang, J., Olatosi, B., Yang, X., Weissman, S., Li, Z., Hu, J., & Li, X. (2022). Studying patterns and predictors of HIV viral suppression using A Big Data approach: a research protocol. BMC Infectious Diseases, 22(1), 122.




How to Cite

Diqi, M., & Hamzah, H. (2024). Improving Stock Price Prediction Accuracy with StacBi LSTM. JISKA (Jurnal Informatika Sunan Kalijaga), 9(1), 10–26.