Gold is a form of investment known as a safe haven asset because of its stability in unstable market conditions. Gold price forecasting is important for investors as decisions making tool. This study aims to study the best long short--term memory (LSTM) hyperparameters (optimizer, learning rate, and epoch) from cross--validation for forecasting. LSTM, as part of deep learning methods, is developed based on a RNN widely used in time series forecasting. LSTM is superior compared to other methods for its ability to minimize errors and forecast for long--term periods. Walk--forward validation with sliding and extending window scenarios as a form of cross--validation is used to see the method's accuracy. The used data is sourced from the World Gold Council with daily data periods for January 1, 2003, to December 31, 2023. The optimizer used is Adam and RMSProp, each with learning rate values of 0.01, 0.001, 0.0001, and epoch values of 100, 500, 1000. The best model uses the Adam optimizer, a learning rate of 0.01, and an epoch value of 100 with a MAPE value of 0.4867\% in the validation process. Forecasting results show a tendency for gold prices to increase in the next eight years.