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.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.