12/01/2025
(Code) Bitcoin Growth Performance in Comparison to QQQ, XIT, SPY. Note: Bitcoin is very volatile. This is for information purpose only.
Data Download:
tickers = [
'BTC-USD',
'BTC-CAD',
'XIT.TO',
'QQQ',
'SPY'
]
#'FBTC',
#'BTCX.B',
#'BTCO.B'
# --- GET DATA ---
data = {}
start = "2014-01-01";
end = "2025-11-30";
download_interval = "1d";
ticker_list = tickers;
risk_free_annual = 0.02 # 2% annual risk-free; adjust if you prefer
df = {}
# Download historical data using the daily time frame for the start and end date
for ticker in tickers:
df[ticker] = yf.download(ticker, interval = download_interval, start = start, end = end )
data[ticker] = df[ticker]['Close'];
= data['Close']
the graph
# --- DAILY RETURNS ---
rets = prices.pct_change().dropna()
# --- CUMULATIVE RETURNS (log scale) ---
cumret = (1 + rets).cumprod()
plt.figure(figsize=(12,6))
for col in cumret.columns:
plt.plot(cumret.index, cumret[col], label=col)
plt.yscale('log')
plt.title("Cumulative Return (log scale) - Last 10 years")
plt.legend()
plt.tight_layout()
plt.savefig("cumulative_returns_log.png", dpi=1200)
plt.show()
Ref: Code mostly by AI Tools where a bit of code reused from a project done by me in the past.