Document Type : Original Article
Authors
1
Master’s Student in Software Engineering, Imam Khomeini International University, Qazvin, Iran
2
Assistant Professor, Department of Computer Engineering, Imam Khomeini International University, Qazvin, Iran
10.22034/tdas.2025.228265
Abstract
Gold is widely recognized as one of the most volatile and potentially profitable financial instruments, yet it can also result in significant losses. Consequently, even small price movements can generate substantial gains or losses for traders. In the present study, we developed a machine learning model for short-term forecasting of gold prices with a minimum expected accuracy of 60%. The forecasting problem was formulated as a binary classification task. Considering sound capital management principles, a model with 60% predictive accuracy can enable a trader to achieve profitability in the financial market. Assuming an initial capital of $100 per trade, a profit of $1 per successful trade, a loss of $1 per unsuccessful trade (i.e., a risk-reward ratio of 1:1), and a model success rate of at least 60%, one could achieve a net gain of $10 or a 10% return over 100 trades—an acceptable result. After building and optimizing the model, we achieved an accuracy of 66%, approximately 6% higher than the baseline assumption. To further improve model reliability and validate predictions, we tested the model using weekly and monthly data. The model performed poorly on weekly data, likely due to the limited sample size at this time scale. In contrast, the model demonstrated acceptable accuracy on monthly data, suggesting its utility for validating daily predictions. Monthly data typically contain lower noise and volatility than other time frames, which may explain the higher accuracy observed at this scale. For comparison with previous studies, we selected two articles that predicted gold prices as a regression task and one article that predicted price direction. Results indicate that the proposed method has two key advantages over prior approaches: 1) the predictive power of deep neural networks and 2) the effectiveness of incorporating the price action methodology—particularly the inside bar technique—in forecasting gold price direction.
Keywords