Home

Awesome

Bitcoin - Basic MACD Trading Strategy

Go long when the MACD crosses above the signal line, close out the position when it crosses back under. Vice versa for short positions (optional).

Example - Default MACD settings, Long only

From a risk return perspective, this simple strategy seems to outperform buy and hodl in the long run.

source("config/Config.R")
btc.close <- FetchBTCInfo(param           = "market-price",   
                          data.identifier = "btc.close", 
                          date.start      = "2012-01-01")
names(btc.close) <- "close"

btc.results <- SimpleMACDStrategyUnivariate(asset         = btc.close, 
                                            asset.name    = "BTC CHART",
                                            nFast         = 12,
                                            nSlow         = 26,
                                            nSig          = 9,
                                            long.only     = TRUE,
                                            plot.strategy = TRUE,
                                            plot.results  = TRUE,
                                            strategy.name = "MACD Strategy")

Donations

If you find this software useful and/or you would like to see additional extensions, feel free to donate some crypto:

Or preferably, donate some of my favorite coins :)

Licensing

Copyright 2017 Essential Data Science Consulting ltd. (EssentialQuant.com / jellenvermeir@essentialquant.com). This software is copyrighted under the MIT license: View added LICENSE file.