Introduction

I have noticed that bitcoin price has just roughly reached the price of 1kg of gold, again, after a long time. One can easily verify this at Wolfram Alpha:

In[]:=
1kg gold price / bitcoin
Result
1.021
Out[]=
1.021
Or simply checking online:
https://wolfr.am/GOLD-BTC
This happened in the past already but just a few times. Coincidentally this happens exactly at the moment when both bitcoin and gold hit record highs.
The price of gold is standardly given for the value of one troy ounce -- an equivalent to roughly 31 grams:
In[]:=
UnitConvert
,"Grams"//N
Out[]=
31.1035
g
So when the price of gold is listed it is not immediately obvious what value 1kg of gold has, unless one does the unit conversion. Here I will show how easy it is to import data and plot prices for 1kg gold and bitcoin together so the history and various moments are clear.

Financial background

SUMMARY: Bitcoin

◼
  • SOURCE: https://www.investopedia.com/bitcoin-storms-past-usd69k-to-all-time-high-8604280
  • ◼
  • Bitcoin soared past its previous all-time high of $69,000 set in Nov. 2021.
  • ◼
  • The largest cryptocurrency by market cap gave up some of those gains, retreating as some traders took profits
  • ◼
  • Supporters say high demand and low supply, alongside the SEC approval of spot bitcoin ETFs, are responsible for the rally.
  • ◼
  • Skeptics see no change in fundamentals; some analysts say ETFs would add to price volatility.
  • SUMMARY: Gold

    ◼
  • SOURCE: https://www.investopedia.com/why-did-gold-prices-hit-all-time-highs-8604361
  • ◼
  • The price for spot gold reached a new record high and has surged 5% in the past month.
  • ◼
  • Rising expectations for interest rate cuts have aided gold’s rise.
  • ◼
  • Recent economic data have boosted investors’ rate-cut hopes; election uncertainty may provide additional support.
  • Importing data

    Start from importing bitcoin (BTC) data valued in US$:
    In[]:=
    FinancialData["BTC/USD",{2015},Method->"Legacy"]​​BTCdata=TimeSeries@%
    Out[]=
    {{{2015,1,1},320.035},{{2015,1,2},315.255},{{2015,1,3},315.415},{{2015,1,4},288.175},{{2015,1,5},264.945},{{2015,1,6},273.957},{{2015,1,7},282.556},{{2015,1,8},292.251},{{2015,1,9},285.659},
    ⋯3283⋯
    ,{{2024,2,27},56799.4},{{2024,2,28},61015.1},{{2024,2,29},61433.6},{{2024,3,1},61995.2},{{2024,3,2},61876.9},{{2024,3,3},62673.8},{{2024,3,4},66884.5},{{2024,3,5},65229.8},{{2024,3,6},67147.1}}
    Full expression not available
    (
    original memory size:
    0.6 MB)
    Out[]=
    TimeSeries
    Time:
    01 Jan 2015
    to
    06 Mar 2024
    Data points: 3301
    Regular: False
    Output dimension: 1
    Metadata: None
    Minimum increment: {1,Day}
    Resampling: {Interpolation,1}
    
    As I mentioned earlier, imported gold price data is usually given for the value of one troy ounce of gold. It is equivalent of roughly 31 grams. To convert price for 1kg of gold we need to compute the multiplication factor proportionally to masses ratio:
    In[]:=
    N
    1
    kg
    
    1
    oz t
    
    Out[]=
    32.1507
    Hence, the price data for 1kg of gold is obtained as:
    In[]:=
    FinancialData["XAU/USD",{2015},Method->"Legacy"];​​MapAtN
    1
    kg
    
    1
    oz t
    #&,%,{All,2}​​GoldData=TimeSeries@%
    Out[]=
    {{{2015,1,1},38031.8},{{2015,1,2},37664.6},{{2015,1,3},38243.6},{{2015,1,5},38547.1},{{2015,1,6},38900.8},{{2015,1,7},38981.2},{{2015,1,8},39084.1},{{2015,1,9},39084.1},
    ⋯3074⋯
    ,{{2024,2,28},65420.1},{{2024,2,29},65726.5},{{2024,3,1},66955.6},{{2024,3,2},66955.6},{{2024,3,3},66984.9},{{2024,3,4},67987.5},{{2024,3,5},68427.6},{{2024,3,6},69046.2}}
    Full expression not available
    (
    original memory size:
    0.6 MB)
    Out[]=
    TimeSeries
    Time:
    01 Jan 2015
    to
    06 Mar 2024
    Data points: 3090
    Regular: False
    Output dimension: 1
    Metadata: None
    Minimum increment: {1,Day}
    Resampling: {Interpolation,1}
    
    Finally the plot is computed as:
    In[]:=
    DateListPlot[{GoldData,BTCdata},PlotTheme->"Detailed"]
    Out[]=

    Alternative data methods: Entity framework and more

    Entity framework is another excellent method to get financial data. Consider this code extracting out gold data in a different way:
    In[]:=
    Entity["Element","Gold"][​​Dated[EntityProperty["Element","Price"],​​DateInterval[{{2015},Today}]]]
    Properly formatted it looks compact and nice:
    In[]:=
    gold
    ELEMENT
    Dated
    price
    ,DateInterval
    Beginning: Thu 1 Jan 2015
    Through: Thu 7 Mar 2024
    
    Out[]=
    TimeSeries
    Time:
    01 Jan 2015
    to
    06 Mar 2024
    Data points: 3090
    
    For bitcoin we can use another alternative method of
    CurrencyConvert
    . It uses exchange rate information provided by
    FinancialData
    for conversion between currency units.
    In[]:=
    CurrencyConvert["BTC","USDollars",{{2015},Today}]
    Out[]=
    TimeSeries
    Time:
    01 Jan 2015
    to
    07 Mar 2024
    Data points: 3302
    

    Final graphics design

    In[]:=
    Framed[DateListPlot[{GoldData,BTCdata},PlotLegends->Placed[Style[#,17]&/@{"Gold, 1kg","Bitcoin, BTC"},{Left,Top}],PlotTheme->"Detailed",BaseStyle->19,FrameLabel->{"YEAR","US$"},ImageSize->700,​​PlotLabel->Style["1 BITCOIN reaches 1kg GOLD while both hit record highs",35,GrayLevel[.1],FontFamily->"DIN Condensed"]]//Rasterize//ColorNegate,Background->Black,FrameMargins20]
    Out[]=

    CITE THIS NOTEBOOK

    1 Bitcoin reaches 1kg Gold price while both hit record highs​
    by Vitaliy Kaurov​
    Wolfram Community, STAFF PICKS, March 7, 2024
    ​https://community.wolfram.com/groups/-/m/t/3137014