Optimized BiLSTM and GRU Models Using QHBM for Forex Price Prediction
DOI:
https://doi.org/10.30812/matrik.v25i3.6226Keywords:
Deep Learning, Foreign Exchange, Prediction, Hyperparameter OptimizationAbstract
The foreign exchange market is highly volatile and complex, making accurate price prediction challenging. This study aims to develop an optimized deep learning framework for predicting daily closing prices of seven major currency pairs (AUDUSD, EURUSD, GBPUSD, USDCAD, USDCHF, USDCNY, and USDJPY) by integrating Bidirectional Long Short-Term Memory (BiLSTM) and Gated
Recurrent Unit (GRU) models with optimization strategies. Historical data from the Federal Reserve Economic Data were evaluated using Fixed Date Split and Walk Forward Validation (WFV), where WFV consistently achieved better performance than the fixed date. To enhance model performance, hyperparameter optimization was conducted using the Queen Honey Bee Migration (QHBM) algorithm, a metaheuristic approach inspired by the migration behavior of queen bees, divided into two characteristics: high learning rate and low learning rate. The optimized models achieved performance improvements of approximately 10-70% in MAPE and RMSE compared to the baseline models, while maintaining high R2 values. The results indicate that optimal configurations are pair-specific, where
most currency pairs perform best with a high learning rate and high unit settings, while AUDUSD achieves superior performance with a low learning rate and low unit configuration. This study contributes a novel integration of WFV and QHBM-based optimization. Adaptive deep learning models with proper validation significantly improve forecasting accuracy, robustness, and generalization for
financial decision-making and algorithmic trading applications.
Downloads
References
[1] B. Eichengreen, R. Lafarguette, A. Mehl, and M. Ferrari Minesso, “Technology and the geography of the foreign exchange
market,” Journal of International Money and Finance, vol. 131, p. 102802, Mar. 2023, https://doi.org/10.1016/j.jimonfin.2023.
102802.
[2] C. Kookanok, S. Lertsakulbunlue, M. Poochanasri, and N. Aiumtrakul, “WCN26-4181 Us Economic and Kidney Transplant
Awareness: Fred and Google Time Series Database from 2004 to 2025,” Kidney International Reports, vol. 11, no. 4, p. 104987,
Apr. 2026, https://doi.org/10.1016/j.ekir.2026.104987.
[3] K. C. Guyard and M. Deriaz, “Predicting Foreign Exchange EUR/USD Direction Using Machine Learning,” in Proceedings of
the 2024 7th International Conference on Machine Learning and Machine Intelligence (MLMI). Osaka Japan: ACM, Aug.
2024, pp. 1–9, https://doi.org/10.1145/3696271.3696272.
[4] Y. Qiu, X. Sun, X. Xiong, and S. Si, “Systemic financial risk analysis of the U.S. based on the complex network,” Journal of
Management Science and Engineering, vol. 10, no. 3, pp. 414–433, Sep. 2025, https://doi.org/10.1016/j.jmse.2025.05.002.
[5] Y. Kitamura, “The price discovery in the renminbi/USD market: Two spot, two swap, and three forward FX rates,” International
Review of Financial Analysis, vol. 95, p. 103362, Oct. 2024, https://doi.org/10.1016/j.irfa.2024.103362.
[6] Y.-L. Chen and J. J. Yang, “SDR adjustment and FX liquidity,” Pacific-Basin Finance Journal, vol. 91, p. 102711, Jun. 2025,
https://doi.org/10.1016/j.pacfin.2025.102711.
[7] C. G. Mat´e, “Forecasting in FOREX the spot price interval of tomorrow with the same information of today. An analysis of
the seven majors using a linear regression model based on interval arithmetic,” Knowledge-Based Systems, vol. 258, p. 109923,
Dec. 2022, https://doi.org/10.1016/j.knosys.2022.109923.
[8] S. Perla, R. Bisoi, and P. Dash, “A hybrid neural network and optimization algorithm for forecasting and trend detection of
Forex market indices,” Decision Analytics Journal, vol. 6, p. 100193, Mar. 2023, https://doi.org/10.1016/j.dajour.2023.100193.
[9] P. K. Sarangi, M. Chawla, P. Ghosh, S. Singh, and P. Singh, “FOREX trend analysis using machine learning techniques: INR vs
USD currency exchange rate using ANN-GA hybrid approach,” Materials Today: Proceedings, vol. 49, pp. 3170–3176, 2022,
https://doi.org/10.1016/j.matpr.2020.10.960.
[10] P. Albrecht and E. Koˇcenda, “Volatility connectedness on the central European forex markets,” International Review of Financial
Analysis, vol. 93, p. 103179, May 2024, https://doi.org/10.1016/j.irfa.2024.103179.
[11] F. Alqodri, T.Widiyaningtyas, and D. D. Prasetya, “Comparative Analysis of ARIMA, Random Forest, and BiLSTM for Dollar
Index Prediction in the 21 st Century,” pp. 1–6, 2025, https://doi.org/10.1109/ICEEIE66203.2025.11251582.
[12] N. Mirza, S. K. A. Rizvi, B. Naqvi, and M. Umar, “Inflation prediction in emerging economies: Machine learning and FX
reserves integration for enhanced forecasting,” International Review of Financial Analysis, vol. 94, p. 103238, Jul. 2024, https:
//doi.org/10.1016/j.irfa.2024.103238.
[13] T. Fischer, M. Sterling, and S. Lessmann, “Fx-spot predictions with state-of-the-art transformer and time embeddings,” Expert
Systems with Applications, vol. 249, p. 123538, Sep. 2024, https://doi.org/10.1016/j.eswa.2024.123538.
[14] I. H. Sarker, “Deep Learning: A Comprehensive Overview on Techniques, Taxonomy, Applications and Research Directions,”
SN Computer Science, vol. 2, no. 6, p. 420, Nov. 2021, https://doi.org/10.1007/s42979-021-00815-1.
[15] M. Yang and J. Wang, “Adaptability of Financial Time Series Prediction Based on BiLSTM,” Procedia Computer Science, vol.
199, pp. 18–25, 2022, https://doi.org/10.1016/j.procs.2022.01.003.
[16] A. Chennupati, B. Prahas, B. A. Ghali, B. D. Jasvitha, and K. Murali, “Comparative Analysis of Bitcoin Price Prediction
Models: LSTM, BiLSTM, ARIMA and Transformers,” in 2024 15th International Conference on Computing Communication
and Networking Technologies (ICCCNT), Jun. 2024, pp. 1–7, https://doi.org/10.1109/ICCCNT61001.2024.10724247.
[17] P. T. Yamak, L. Yujian, and P. K. Gadosey, “A Comparison between ARIMA, LSTM, and GRU for Time Series Forecasting,”
in Proceedings of the 2019 2nd International Conference on Algorithms, Computing and Artificial Intelligence. Sanya China:
ACM, Dec. 2019, pp. 49–55, https://doi.org/10.1145/3377713.3377722.
[18] P. Lalwani and R. Ganeshan, “A Novel CNN-BiLSTM-GRU Hybrid Deep Learning Model for Human Activity Recognition,”
International Journal of Computational Intelligence Systems, vol. 17, no. 1, p. 278, Nov. 2024, https://doi.org/10.1007/
s44196-024-00689-0.
[19] S. Hansun, F. P. Putri, A. Q. M. Khaliq, and H. Hugeng, “On searching the best mode for forex forecasting: Bidirectional long
short-term memory default mode is not enough,” IAES International Journal of Artificial Intelligence (IJ-AI), vol. 11, no. 4, p.
1596, Dec. 2022, https://doi.org/10.11591/ijai.v11.i4.pp1596-1606.
[20] L. Vancsura, T. Tatay, and T. Bareith, “Navigating AI-Driven Financial Forecasting: A Systematic Review of Current Status
and Critical Research Gaps,” Forecasting, vol. 7, no. 3, p. 36, Jul. 2025, https://doi.org/10.3390/forecast7030036.
[21] Y. Zhao, W. Zhang, and X. Liu, “Grid search with a weighted error function: Hyper-parameter optimization for financial time
series forecasting,” Applied Soft Computing, vol. 154, p. 111362, Mar. 2024, https://doi.org/10.1016/j.asoc.2024.111362.
[22] H. Dhake, Y. Kashyap, and P. Kosmopoulos, “Algorithms for Hyperparameter Tuning of LSTMs for Time Series Forecasting,”
Remote Sensing, vol. 15, no. 8, p. 2076, Apr. 2023, https://doi.org/10.3390/rs15082076.
[23] M. M. O¨ ztu¨rk, “Hyperparameter Optimization of a Parallelized LSTM for Time Series Prediction,” Vietnam Journal of Computer
Science, vol. 10, no. 03, pp. 303–328, Aug. 2023, https://doi.org/10.1142/S2196888823500033.
[24] A. Aripriharta, M. S. Al Rasyid, M. C. Bagaskoro, I. Fadlika, S. Sujito, A. N. Afandi, S. Omar, and N. Rosmin, “Queen
honey bee migration (QHBM) optimization for droop control on DC microgrid under load variation,” Journal of Mechatronics,
Electrical Power, and Vehicular Technology, vol. 15, no. 1, pp. 12–22, Jul. 2024, https://doi.org/10.55981/j.mev.2024.742.
[25] D. Irmanto, A. Aripriharta, and S. Sujito, “Multi-Objective Optimization of Tactical Rescue Strategies Using QHBM and IoT
in Urban Conflict Zones,” Journal of Wireless Mobile Networks, Ubiquitous Computing, and Dependable Applications, vol. 16,
no. 2, pp. 833–851, Jun. 2025, https://doi.org/10.58346/JOWUA.2025.I2.051.
[26] T. Mahmud, T. Akter, S. Anwar, M. T. Aziz, M. S. Hossain, and K. Andersson, “Predictive Modeling in Forex Trading: A
Time Series Analysis Approach,” in 2024 Second International Conference on Inventive Computing and Informatics (ICICI).
Bangalore, India: IEEE, Jun. 2024, pp. 390–397, https://doi.org/10.1109/ICICI62254.2024.00070.
[27] M. S. Islam, E. Hossain, A. Rahman, M. S. Hossain, and K. Andersson, “A Review on Recent Advancements in FOREX
Currency Prediction,” Algorithms, vol. 13, no. 8, p. 186, Jul. 2020, https://doi.org/10.3390/a13080186.
[28] M. Ayitey Junior, P. Appiahene, and O. Appiah, “Forex market forecasting with two-layer stacked Long Short-Term Memory
neural network (LSTM) and correlation analysis,” Journal of Electrical Systems and Information Technology, vol. 9, no. 1,
p. 14, Dec. 2022, https://doi.org/10.1186/s43067-022-00054-1.
[29] B. M. Henrique and E. Santos, “Cryptocurrencies trading using Parrondo’s Paradox,” International Review of Economics &
Finance, vol. 105, p. 104859, Jan. 2026, https://doi.org/10.1016/j.iref.2025.104859.
[30] F. A. Rahman, T. Widiyaningtyas, H. R. Adha, A. A. Smaragdina, L. A. Chisbiyah, and L. L. Pramita, “Comparative Performance
Analysis of Decision Tree and K-Nearest Neighbors (KNN) Algorithms for Malformed Food Aroma Classification,”
in 2024 IEEE 2nd International Conference on Electrical Engineering, Computer and Information Technology (ICEECIT).
Jember, Indonesia: IEEE, Nov. 2024, pp. 153–157, https://doi.org/10.1109/ICEECIT63698.2024.10859612.
[31] M. Shantal, Z. Othman, and A. A. Bakar, “A Novel Approach for Data Feature Weighting Using Correlation Coefficients and
Min–Max Normalization,” Symmetry, vol. 15, no. 12, p. 2185, Dec. 2023, https://doi.org/10.3390/sym15122185.
[32] J. Gao, C. Fan, T. Liu, X. Bai, W. Li, and H. Tan, “Embracing market dynamics in the post-COVID era: A data-driven analysis
of investor sentiment and behavioral characteristics in stock index futures returns,” Omega, vol. 131, p. 103193, Feb. 2025,
https://doi.org/10.1016/j.omega.2024.103193.
[33] A. M. Hagag, L. S. Yousef, and T. F. Abdelmaguid, “Multi-Criteria Decision-Making for Machine Selection in Manufacturing
and Construction: Recent Trends,” Mathematics, vol. 11, no. 3, p. 631, Jan. 2023, https://doi.org/10.3390/math11030631.
[34] M. F. B. Hossain, L. Z. Lamia, M. M. Rahman, and M. M. Khan, “FinBERT-BiLSTM: A deep learning model for predicting
volatile cryptocurrency market prices using market sentiment dynamics,” Applied Intelligence, vol. 56, no. 3, p. 89, Feb. 2026,
https://doi.org/10.1007/s10489-026-07086-4.
[35] S. Suradhaniwar, S. Kar, S. S. Durbha, and A. Jagarlapudi, “Time Series Forecasting of Univariate Agrometeorological Data:
A Comparative Performance Evaluation via One-Step and Multi-Step Ahead Forecasting Strategies,” Sensors, vol. 21, no. 7, p.
2430, Apr. 2021, https://doi.org/10.3390/s21072430.
[36] M. L. Hossain, S. M. N. Shams, and S. M. Ullah, “Time-series and deep learning approaches for renewable energy forecasting
in Dhaka: A comparative study of ARIMA, SARIMA, and LSTM models,” Discover Sustainability, vol. 6, no. 1, p. 775, Aug.
2025, https://doi.org/10.1007/s43621-025-01733-5.
[37] S. Hansun, F. P. Putri, A. Q. M. Khaliq, and H. Hugeng, “On searching the best mode for forex forecasting: Bidirectional long
short-term memory default mode is not enough,” IAES International Journal of Artificial Intelligence (IJ-AI), vol. 11, no. 4, p.
1596, Dec. 2022, https://doi.org/10.11591/ijai.v11.i4.pp1596-1606.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Febrianto Alqodri, Triyanna Widiyaningtyas, Didik Dwi Prasetya

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Febrianto Alqodri
.png)











