DataScience: My Project

By Jamie Broadhurst

Project portfolio using data from: CoinAPI, MetalsAPI and Investing.com.

Can Bitcoin really be considered digital Gold?

The aim of this project is to see whether Bitcoin can really be considered digital Gold. For this project to be a success, it is vital to define what digital Gold would look in a hypothetical state.

I believe this would be characterised by an asset that is of course digital, implying it is easy to transport and can be used via technology. More importantly, what is Gold? Gold is tangible and has been used as a medium of exchange for centuries. It has intrinsic value; this inherent value is derived from its scarcity. Nowadays, due to its characteristics, it is considered an inflation hedge and a safe-haven asset as, over the years Gold has risen in value with the ever-rising cost of living. Therefore, my interpretation of Gold is an asset that is a secure, relatively predictable investment which is backed by physical bullions. These bullions will always have value as they can be melted down and used in jewellery, semiconductors, and even medicine, to name a few.

Bitcoin and Gold: Live Price

The data used throughout this project is from three data sources. I signed up for CoinAPI and MetalsAPI so I could access their respective API keys, for use in my live price charts. Bitcoin’s live price graph uses data from CoinAPI and will automatically update as the API link was included in the Vega specification. Whereas the live Gold price graph replicates data from MetalsAPI and is written in-line JSON.

The rest of the graphs use data that I scraped using Python in Colab from investing.com. Using the investpy software library, I was able to access data for both Bitcoin and Gold. Utilising my Python script, most of the process is automated which means my graphs can be updated within a matter of minutes. I decided to use this website over Yahoo Finance as there was a larger dataset available for Bitcoin which goes back to August 2010 rather than September 2014.

Bitcoin: Long Run Price and Volume since 2010

Gold: Long Run Price and Volume since 2010

As evident from the first two graphs, we can see that even just over the past month Bitcoin’s price has been more volatile than Gold’s. This idea can be furthered if we look at Bitcoin and Gold’s long run price. Bitcoin’s price has risen from $0.1 to a peak of $65,459 on 14th November 2021. Whereas the price of Gold has fluctuated through a relatively small range of $960.46 over the past 11 years.

BTC vs Gold: Normalised Prices and Z-Score Graph

Looking at the Min-Max and Z-Score graphs, it is evident that the two assets have followed similar price movements from 2018 to 2020, deviating in 2020, at the start of the Coronavirus pandemic, when lots of investors put money into the safe-haven asset – Gold. Through 2021, we can further see Bitcoin’s price volatility as it’s Z-Score swings over x4 that of Gold’s.

The link to my Colab notebook for all my data analysis is available here.

The first challenge I had to overcome was that Gold doesn’t trade everyday like Bitcoin. So, when I merged the datasets into a Pandas DataFrame Bitcoin had far more observations. To overcome this, I took the weekly average of close prices for both assets from the daily dataset using the .resample() function in Python.

Another challenge was with the output from MetalsAPI. I decided to replicate the data from the API link in-line JSON due to the output being incompatible for Vega manipulation. Instead, I manually created an array of data points within Vega. I also had to use a calculate function to convert the price of Gold into USD.

I decided to export the data from Python for the Min-Max and Z-Score graphs to a .csv file so I could use the raw GitHub file within Vega. This was so my website looked more consistent throughout. Also, the .png files proved tricky to view nicely on a mobile.

Throughout, I used the Vega documentation to troubleshoot issues with various problems I encountered; mostly with performing transforms such as filter and calculate.

Linear regression: BTC vs Gold

The linear regression of Bitcoin against Gold shows an R-Squared value of 0.30 since 2010, suggesting that there is some correlation but, this doesn’t necessarily imply causation. The greatest R-Squared value is 0.53 over the period, 2015-2020, implying that when Bitcoin has a price above $1,000 there is greater correlation between the average weekly close price of the two assets.

Overall, Bitcoin cannot be considered digital Gold since they don’t exhibit similar characteristics. Firstly, it isn’t tangible so lacks intrinsic value. Secondly, its price volatility is far greater than that of Gold. Yes, it is scarce since there is a fixed supply but it is not a secure, predictable store of value hence, it is a speculative asset. All things considered, it is a much risker investment than Gold. Although it has significantly outperformed Gold over the past 10 years, its value could drive to zero if there was an EMP attack on Earth’s technology. Then, only people with physical bullions would be able to successfully barter, rendering Bitcoin worthless.

Note: Further analysis could be completed if intraday data was available for both assets.




Total word count - 837