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. Подробнее читайте в Условиях использования.