The purpose of this study was to determine the optimal algorithm to estimate the price of gold and identify the variables most incident to its variation. An exploratory level methodology, quantitative approach and non-experimental design was used. The results obtained when performing EDA show that the variables with the highest correlation with respect to the price of gold are the cost of production with 44% and the S&P_500 with 30%. When validating the models, the result was that the Gradient boosting algorithm has an optimal R2 of 99.4%, this value justifies the importance of the model in order to estimate the price of gold. Likewise, without leaving aside the Random Forest algorithm, it also shows an R2 of 99.3%. Likewise, it was identified that the variables with the highest incidence are Cost_prod with 51.5% and USD_X with 30.4%. Finally, it is concluded that the use of these algorithms such as Gradient boosting and Random Forest can estimate the price of gold taking into account the variables that affect its variation.