Skip to content

Latest commit

 

History

History
50 lines (41 loc) · 2.1 KB

File metadata and controls

50 lines (41 loc) · 2.1 KB

Trading Strategies

This demo utilizes the Coinbase Pro public end points and the Coinbase Pro client for Python

Reference: Chapter 15 Trading Strategies, Python For Finance, 2nd edition

The data files used are provided for convenience:

Case 1:

An SMA Strategy is Backtested using Bitcoin-US Dollar (BTC-USD) data from Coinbase Pro public data-endpoint. BTC-USD SMA Plot

Cumulative:
Returns     1.199487
Strategy    1.027011

Volatility:
Returns     0.140443
Strategy    0.140796

The log returns for BTC-USD are shown in a histogram, illustrating 'fat-tails'. BTC-USD Returns

Case 2:

Linear Ordinary Least Squares (OLS) Regression is backtested and compared to daily returns OLS Backtest Results

Cumulative:
returns        1.254766
strat_ols_1    1.322613
strat_ols_2    1.229719

Case 3:

k-means clustering is demonstrated and compared to OLS results k-means clustering

Cumulative:
returns       1.254766
strat_clus    1.396107

Jupyter Lab Notebook:

The notebook contains all the source code to reproduce the results summarized above. The data files need to be saved in the same directory as the notebook. The data files can be refreshed using the Coinbase Pro public data end points, which are referenced in comments through-out the notebook. Notebook