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.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.