This is a collection of me playing around with crypto data and building out some basic ML strategies.
- Bitcoin Coinbase Exchange Historic Prices: https://www.coinbase.com/api/v2/assets/prices/5b71fc48-3dd3-540c-809b-f8c94d0e68b5?base=USD
- Coinbase API Docs: https://docs.pro.coinbase.com/#get-historic-rates
- Last 24 hour spot price
- Last n days daily Bitcoin price data
- Google Search Trends Previous 7 days
- "is bitcoin crashing"
- "how to buy bitcoin"
- Last n days daily S&P price data
- Bollinger Bands
- Relative Strength Index (RSI)
- Momentum
- Z-score
- Install Python3 and pipenv
pipenv shell
to start a shell with the virtual envpipenv install
to install dependencies to the virtual envpip install git+https://github.com/bartosh/backtrader.git@ccxt
install Ed Baratosh's branch with cctx support (never added to main repository)python -m ipykernel install --user --name=quant-trading
to make virtual env available as kernel for jupyterjupyter notebook
Requires a special branch of backtrader with support for cctx (live exchanges) for data feeds
Scenario
- $10,000 starting cash
- January 1st, 2016 - December 31st, 2020
- Strategy: Market Buy and HODL Performance
- Total Return: 413%
- Sharpe Ratio: 0.707
- Maximum Drawdown: 83.69361893711935%
Model
- Neural Network binary classifier on hourly tick data
- Features are all moving average diffs over different lookbacks Performance