This repository contains the analysis of price and network data related to Bitcoin and other cryptocurrencies. I made the repository just for fun; no investment purposes nor advice intended here.
🚧 This project is on-going, not finished.
First, install an environment manager, e.g., conda, create an environment and install the required dependencies:
# Create your env
conda create --name crypto pip python=3.8
conda activate crypto
# Install all necessary packages
# FIXME: Many packages can be removed
pip install -r requirements.txt
Then, open the notebooks, sequentially.
The folder data/
contains all the raw data used for the analysis. These data is not uploaded to the repository; you need to contact me if you would like access to it.
The repository contains the following notebooks:
00_DataPreparation.ipynb
: raw datasets in./data
are pre-processed; these are related to BTC, ETH, XMR, and the global crypto market. Also, several APIs are tested, but not really used yet: Quandl, Coinmarketcap, Google Trends Unofficial, Coingecko.01_BitcoinAnalysis.ipynb
: price level anaylsis of BTC in different halving cycles, support polynomial computation, comparisons of BTC to ETH and SPY (scatterplots, regressions, histograms, etc.).02_PortfolioAnalysis.ipynb
: Monte Carlo simulations are performed to compute the optimum portfolio allocation (BTC, ETH, XMR) following the Markowitz method. The optimum portfolio has the highest Sharpe ratio and it is on the efficient frontier.03_CryptoCAPM.ipynb
: thealpha
(intercept) andbeta
(slope) of BTC and ETH returns are computed with respect to the global crypto market returns performing simple linear regressions. According to CAPM,alpha
should tend to0
, but hedge funds try to choose assets with highalpha
values and lowbetas
to hedge their gains.
Mikel Sagardia, 2020.
No guarantees.
Check the LICENSE
.