Research Article

Gold Futures Price Prediction Using Transformer Deep Learning Models with Data Scraped via UiPath

DOI:

10.3791/68903

September 26th, 2025

In This Article

Summary

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The study develops a transformer deep learning model to accurately predict gold prices using historical data from 2014 to 2024. Achieving 93% accuracy, the model outperforms traditional methods by capturing complex trends and dependencies. It aids investors and policymakers in decision-making and suggests future improvements using sentiment analysis and global factors.

Abstract

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Gold is one of the most valuable and widely traded commodities worldwide, particularly in India, and plays a significant role in economic and financial markets. Historically, gold has been a cornerstone of international trade and economic stability, with central banks maintaining reserves to manage inflation and foreign debt. The price of gold serves as a key economic indicator that influences market trends and investment strategies. However, accurately predicting gold prices is challenging due to the complex and nonlinear nature of financial markets which are influenced by various factors including interest rates, economic recessions, oil price fluctuations, and geopolitical events. The study transformer model was used to predict the daily gold prices which were collected from investing.com through web scraping by using UiPath. It is a Robotic Process Automation (RPA) platform to preserve the integrity of the data and enhance model performance, preprocessing operations such as missing data handling and MinMax scaling were performed. The model was tested and trained on key performance metrics and achieved a Mean Squared Error (MSE) of 0.0224, Root Mean Squared Error (RMSE) of 0.1496, and R-squared of 0.93, with a high prediction accuracy. The study results confirm that the transformer model efficiently detects short-term price movements and long-term market trends offering a more accurate and dependable method than traditional forecasting methods. The study provides valuable guidance to investors, financial analysts and policymakers in making informed decisions in the gold bullion market. Future research can be improved by the inclusion of alternative data sources such as sentiment from news headlines and social media which can potentially offer richer insight into market movements.

Introduction

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

Gold is one of the most significant commodities in the financial markets, a critical economic resource and a price-controlling tool. Gold constitutes a substantial portion of central bank reserves in many countries1. Recently, gold has become more well-known as an inflation hedge2. It is a key hedging asset and its volatility forecasting improves using Generalized Autoregressive Conditional Heteroskedasticity - Mixed Data Sampling (GARCH-MIDAS) models that account for asymmetry, extremes, and jumps3. India and China are the largest importers and consumers of gold accounting for approximately 60% o....

Access restricted. Please log in or start a trial to view this content.

Protocol

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The methodology for this research is a systematic process designed to develop a transformer model for gold price prediction. Data collection is the initial step where historical gold price data and relevant financial indicators are gathered to form a comprehensive dataset. The dataset undergoes data preprocessing, model development, evaluation, performance metrics and finally gold price prediction with a detailed explanation in the subsequent sections.

Data collection and reliability:
Historical gold price data for this study were collected using an automated process developed on the UiPath Robotic Process Automation (R....

Access restricted. Please log in or start a trial to view this content.

Results

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

In the study analysis performance metrics were assessed through historical data these metrics were used to give a comprehensive picture of how well the transformer model predicted the future gold prices.

In Figure 3, the gold price candlestick chart presents a thorough visual representation of price swings, emphasizing significant patterns, market corrections, and stable intervals across time. To make it simpler to follow market movements each candlestick represen.......

Access restricted. Please log in or start a trial to view this content.

Discussion

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The present study proposed a transformer deep learning model that uses data scraped by UiPath, an automated platform ensuring the timely and organized acquisition of financial data to predict the gold futures prices with improved accuracy and reliability. The model incorporates data on the price of gold with important technical indicators like volume metrics, 30-day and 100-day moving averages, trends, gold price prediction, and candlestick patterns. Outperforming conventional models like LSTM, CNN-LSTM, and linear regre.......

Access restricted. Please log in or start a trial to view this content.

Disclosures

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

The authors have no conflict of interest in this research work.

Acknowledgements

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,

This research was supported by VIT-AP University, Amaravati, India.

....

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
Data SourceInvesting.comhttps://in.investing.com/commodities/gold-historical-dataInvesting.com is a financial market platform that provides market quotes, information about stocks, futures, etc.  
Transformer Model (Python implemented in Google Colab)Googlehttps://colab.research.google.com/Developed a python source code for data analysis to extract insights from data, and that code has been executed on this Google Colab virtual environment
UiPath Robotic Process Automation UiPath, Inc.https://www.uipath.comTo extract the data from the source, and the code has been executed on this platform UiPath Studio.

References

Loading...
$$\rightleftharpoonup{xx}$$ $$\longleftharp{xx}$$, $$\longrightharp{xx}$$,
  1. Aye, G., Gupta, R., Hammoudeh, S., Kim, W. J. Forecasting the price of gold using dynamic model averaging. Int Rev Financ Anal. 41 (2), 257-266 (2015).
  2. Oloko, T. F., Ogbonna, A. E., Adedeji, A. A., Lakhani, N. Oil price shocks and inflation rate persistence....

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Request permission to reuse the text or figures of this JoVE article

Request Permission

Tags

Gold Price PredictionTransformer ModelWeb ScrapingUiPath AutomationFinancial MarketsTime Series ForecastingEconomic IndicatorsMarket TrendsPrediction Accuracy

Related Articles