OPEN-SOURCE SCRIPT
Gold Fair Value (IDR per Gram)

Gold Fair Value (IDR per Gram)
This indicator calculates the theoretical fair value of gold in Indonesian Rupiah per gram based on the global gold price and the USD/IDR exchange rate.
The calculation follows a simple market conversion:
Global gold prices are quoted in USD per troy ounce, while local gold prices in Indonesia are typically quoted in IDR per gram. Since 1 troy ounce equals 31.1035 grams, the indicator converts the global gold price into grams and then multiplies it by the current USD/IDR exchange rate.
Formula used:
Gold Price per Gram (IDR) =
(XAUUSD ÷ 31.1035) × USDIDR
Where:
XAUUSD = Global gold price in USD per troy ounce
31.1035 = grams in one troy ounce
USDIDR = USD to Indonesian Rupiah exchange rate
The indicator displays:
• A line showing the estimated fair value of gold per gram in IDR
• A table summarizing the current gold price, exchange rate, and calculated fair value
This value represents the theoretical spot price of gold if converted directly from the global market.
Keep in mind that retail gold prices in Indonesia may differ due to:
minting and fabrication costs
distribution and dealer margins
brand premium (Antam, UBS, etc.)
buyback spreads
Therefore, the calculated price should be interpreted as a reference baseline rather than the exact retail price.
Traders and investors can use this indicator to quickly compare the global gold market value with local gold prices, helping identify whether gold is relatively expensive or cheap in the domestic market.
This indicator calculates the theoretical fair value of gold in Indonesian Rupiah per gram based on the global gold price and the USD/IDR exchange rate.
The calculation follows a simple market conversion:
Global gold prices are quoted in USD per troy ounce, while local gold prices in Indonesia are typically quoted in IDR per gram. Since 1 troy ounce equals 31.1035 grams, the indicator converts the global gold price into grams and then multiplies it by the current USD/IDR exchange rate.
Formula used:
Gold Price per Gram (IDR) =
(XAUUSD ÷ 31.1035) × USDIDR
Where:
XAUUSD = Global gold price in USD per troy ounce
31.1035 = grams in one troy ounce
USDIDR = USD to Indonesian Rupiah exchange rate
The indicator displays:
• A line showing the estimated fair value of gold per gram in IDR
• A table summarizing the current gold price, exchange rate, and calculated fair value
This value represents the theoretical spot price of gold if converted directly from the global market.
Keep in mind that retail gold prices in Indonesia may differ due to:
minting and fabrication costs
distribution and dealer margins
brand premium (Antam, UBS, etc.)
buyback spreads
Therefore, the calculated price should be interpreted as a reference baseline rather than the exact retail price.
Traders and investors can use this indicator to quickly compare the global gold market value with local gold prices, helping identify whether gold is relatively expensive or cheap in the domestic market.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。