Building of Informatics, Technology and Science
Vol 7 No 4 (2026): March 2026

A Comparative Study of LSTM and BiLSTM Performance in Predicting XAU/USD Prices

Enriko, I Ketut Agung (Unknown)
Gustiyana, Fikri Nizar (Unknown)



Article Info

Publish Date
06 Mar 2026

Abstract

Gold price forecasting in the XAU/USD market is challenging due to nonlinear dynamics, high volatility, and sensitivity to global macroeconomic factors. This study compares the performance of Long Short-Term Memory (LSTM) and Bidirectional Long Short-Term Memory (BiLSTM) architectures in forecasting XAU/USD closing prices using historical data from 2023–2026. Data preprocessing includes cleaning, chronological ordering, normalization, and transformation using a sliding window approach. A window size of 60 time steps is selected to represent approximately three months of daily trading activity, enabling the models to capture short- to medium-term temporal dependencies while limiting excessive noise and computational burden. The dataset is divided chronologically into training and out-of-sample testing sets to ensure proper generalization assessment. Both models employ identical architectures with two recurrent layers (50 hidden units each) and are trained using the Adam optimizer with epoch variations (20–100). Evaluation on unseen test data uses MAE, MSE, RMSE, MAPE, and R² metrics. LSTM achieves its lowest MAE of 21.26 at 40 epochs, while BiLSTM attains its best performance at 80 epochs with an MAE of 20.86 and R² of 0.9981. However, extending training to 100 epochs leads to performance degradation in BiLSTM, indicating sensitivity to overtraining. Overall, optimal performance is achieved through balanced training duration rather than increased architectural complexity.

Copyrights © 2026






Journal Info

Abbrev

bits

Publisher

Subject

Computer Science & IT

Description

Building of Informatics, Technology and Science (BITS) is an open access media in publishing scientific articles that contain the results of research in information technology and computers. Paper that enters this journal will be checked for plagiarism and peer-rewiew first to maintain its quality. ...