Trend-following, volatility targeting and Ensembles for Bitcoin

Today we’ll incrementally build a strategy using trend-following, volatility targeting, and ensemble models and we’ll use Bitcoin as our use-case. Why bitcoin? Because it’s a maddening asset-class that’s extremely volatile over short periods of time and seemed like a fun place to test these concepts.

You might be thinking: an investing strategy for bitcoin is such a cop out, of course it’ll do well because bitcoin itself has done tremendously well! We don’t need your strategy!

Here’s the catch though, we’ll design our strategy only after 1st January 2018, where bitcoin itself hasn’t been doing well at all.

100% long / ‘buy-and-hold’

Let’s first start with basic, 100% buy-and-hold ‘passive’ bitcoin investing. If you’d done that since 1st January 2018, you’d have ended up with the following*:

Annualized Return (CAGR): -13.24%

Annualized Volatility: 80.48%

Sharpe Ratio: -0.16

Ulcer Performance Index: -0.23

Max Daily Drawdown: -81.46%

Ouch! That is crazy high volatility and a soul-crushing maximum drawdown to rival the great depression!

Applying Trend-following

Let’s see what we can do about this. Let’s see if adding a trend-following component helps. As bitcoin is very volatile over short periods of time, we’ll need to have a very active strategy that trades daily. And we’ll need a pretty fast moving trend filter, let’s say half a month, or 15 days. What we do is, every day, we look at the current price and check whether it’s above or below the price 15 days ago. If today’s price is above that level, we stay 100% invested, if it’s below, we move 100% to cash. We keep doing this every day. This strategy would have yielded the following results:

Annualized Return (CAGR): 44.31%

Annualized Volatility: 50.16%

Sharpe Ratio: 0.88

Ulcer Performance Index: 1.82

Max Daily Drawdown: -45.15%

Wow that’s such a major improvement! But our drawdowns are still pretty depressing. Let’s see if we can improve this. And what’s up with the magic number 15? Why not 10, why not 12? Why not 20? And why use the trend-following definition of absolute difference? Why not compare today’s price to the 15 days simple moving average instead?

Enter ensembles!

Are we confident that any of the parameters we selected, even the way we implement trend-following is superior to some other method? Not really. Plus we’re making binary decisions of going completely in or completely out of our asset based on a single number. We can solve both problems by using ensembles.

Think of ensembles as different variants of the same strategy / concept, where each variant casts one vote towards your outcome, which is either 100% cash, or 100% bitcoin** Now our overall decision will be to just add up all the votes, and see how many cast the vote one way or the other. This transforms our decision from a binary one into one of gradation. The folks at newfound have a really cool index made out of this here, they explain it really well in-terms of the difference between a light switch and a dimmer switch. The team at Resolve Asset Management also has an amazing craftsmanship approach to ensembles.

So, now, let’s introduce another variant of our strategy, which uses the simple moving average over 15 days. And let’s ensemble the previous variant and this new one together (weigh both their decisions 50-50). The resulting strategy gives us the following results:

Annualized Return (CAGR): 44.18%

Annualized Volatility: 47.36%

Sharpe Ratio: 0.93

Ulcer Performance Index: 2.26

Max Daily Drawdown: -36.43%

Wow! Almost the same returns, lower volatility and quite a significant lower max drawdown. That’s what we love to see! This is process diversification giving us it’s free lunch 🙂

More ensembles!

Let’s take the same concept and extend it to parameter diversification. Instead of using magic number 15, let’s take all numbers from 10 to 20 as our lookback to define a short lookback. So now we have 11 models for the basic trend-following variant, and 11 models for the simple moving average one, giving us a total of 22 models which cast their vote. This gives us:

Annualized Return (CAGR): 44.86%

Annualized Volatility: 46.44%

Sharpe Ratio: 0.97

Ulcer Performance Index: 2.45

Max Daily Drawdown: -32.75%

Same thing happened again, similar returns, slightly lower volatility, and lower max drawdown.

Adding a dash of volatility targeting

Now, let’s apply the concept we explored in our post leverage up and down and apply short term vol targeting. For simplicity, let’s use the same 10-20 day lookback as our volatility targeting lookback, but let’s target all volatilities from 30 annualized vol to 50 annualized vol. We’ll clip our max leverage at 1.0 as bitcoin is crazy as it is, we don’t want to employ leverage.

This gives us how many models? Let’s calculate, We have 21 different volatility lookbacks (30 to 50). We have 11 different parameters for the volatility lookback (10 to 20). We have 11 different trend following lookbacks (10 to 20) and we have 2 different ways of calculating trend following (absolute difference and simple moving average). This gives us a total of 21*11*11*2 = 5082 models that are all casting their votes together and we are investing based on the percentage they aggregate to on a particular day (53.64% bitcoin and 46.36% cash for example). Running this volatility targeting approach gives us:

Annualized Return (CAGR): 38.24%

Annualized Volatility: 29.98%

Sharpe Ratio: 1.28

Ulcer Performance Index: 3.31

Max Daily Drawdown: -23.06%

That’s really good too. Even though our returns dropped because of the volatility targeting we did (we don’t always run at 100% bitcoin, we rarely do actually), the max drawdown has gone down significantly too. The sharpe ratio and UPI are very good for this kind of strategy (especially considering the underlying was really bad during this time period).

The allocation percentages changing over time can be seen below, notice the ‘dimmer’ switch quality to the plot.

The plot below shows what would’ve happened to $10,000 for buy-and-hold vs. our final strategy since 1st January 2018:

What if you had invested…

Now, just to make this a ‘what if you had invested $10,000 dollars at IPO’ kind of post, let’s compare raw bitcoin returns since 1st January 2012 to present to if you had run this strategy instead.

The raw returns are:

Annualized Return (CAGR): 143.89%

Annualized Volatility: 88.57%

Sharpe Ratio: 1.62

Ulcer Performance Index: 2.76

Max Daily Drawdown: -84.86%

Look at that annualized return, wow! Then look at that drawdown and realize you would never have stuck with it 🙂

Now let’s see what would’ve happened if we ran our final strategy instead:

Annualized Return (CAGR): 110.17%

Annualized Volatility: 32.81%

Sharpe Ratio: 3.36

Ulcer Performance Index: 9.57

Max Daily Drawdown: -23.06%

Lower returns sure, but not by too much. Instead, look at the volatility reduction and the max drawdown during this whole period. This would’ve been something we could stick with!

If you want an allocation to bitcoin in your portfolio, don’t just buy-and-hold it, run it in terms of a dynamic strategy. You’ll still be exposed to the underlying asset class but avoid its horrible volatility and drawdowns.

Bonus Section:

What would happen if instead of just going to cash when our momentum indicator said so, we’d instead shorted the amount specified by the vol targeting? So now our allocation would vary between -1x to 1x exposure to bitcoin. How would one get such exposure? Bitcoin futures are one way. Perpetual swaps might be another.

The returns since 1st January 2018 of adding the ability to go short would’ve given:

Annualized Return (CAGR): 70.38%

Annualized Volatility: 43.24%

Sharpe Ratio: 1.63

Ulcer Performance Index: 7.15

Max Daily Drawdown: -21.51%

Wow, those are eye popping!

* All performance data is based on Tiingo end-of-day daily BTC data

** When we introduce volatility targeting our outcome could be anywhere in between these two extremes too, but the concept remains.

15 thoughts on “Trend-following, volatility targeting and Ensembles for Bitcoin”

  1. Nice article, but don’t leave us hanging… what would have happened to the ‘bonus’ (shorting) if you do an out of sample test back to 2012?

    1. Haha! sure! … surprisingly not too much better than just long only, which is probably because bitcoin over its whole history has mostly just gone up. Drawdowns get worse but the ulcer performance index still improves!

      Long-short strategy since 1st January 2012 (and yes this one is completely hypothetical because futures and perpetual swaps didn’t exist way back then).

      Annualized Return (CAGR): 129.44%
      Annualized Volatility: 41.59%
      Sharpe Ratio: 3.11
      Ulcer Performance Index: 11.45
      Max Daily Drawdown: -33.63%

        1. Sure we see what the annualized volatility of the daily returns is for a given look-back (which is selected to be 10-20 days, which forms a given ensemble). We then divide our desired volatility (selected to be between 30 to 50, again forming a given ensemble) by this annualized volatility. We then get a desired leverage. Finally, we clip all values of leverage greater than 1 to simply 1 as we don’t want to lever our bitcoin exposure. Thus, we get a leverage value between 0 to 1.

          1. Thanks! BTW: for lookbacks I tend to use multiplies (eg. 10, 12, 14, 17, 21 – rounded values for 1.2 factor and 10 as a starting lookback). This gives better distribution of values.

            1. Thanks for the suggestion! We quickly whipped this strategy up just as an example to apply trend-following and ensemble concepts to. Our proprietary traditional market based strategies that we offer for subscription use much more sophisticated thought though 🙂

              Its still amazing though that one can apply these concepts even in a rough fashion and get quite good performance.

  2. Very nice showcase of the power of ensembles, thanks!

    Wondering about transaction costs… what is the turnover? For example, computed as the sum of the absolute value of the differences in allocation from one day to another.

    1. Because of the daily trading this strategy is pretty high turnover. Using what you suggested the whole portfolio would turn over 26.07 times in a year on average. Now if you’re paying 0.5% fee per transaction (and we’re not even mentioning fixed cost) thats a straight 13% drag on your portfolio making something like this probably untenable. However, thankfully, there are commission-free brokers like Robinhood. Though again, slippage isn’t accounted for here.

      One interesting way of reducing turnover with ensembles while retaining the performance is to do the following. After the signal has been generated, round out signal to the closest x%. So for example, if I round out the signals generated here to the nearest 25% (meaning my allocations are only ever 0%, 25%, 50%, 75%, 100%). This sometimes helps in reducing the turnover (though it didn’t help much in this case).

    2. Yes, Bitcoin can often have wide bid/ask spreads. It would be good to see the returns net of transaction costs, which are likely to be much lower. Any analysis that does not incorporate transaction costs is misleading. Good work on demonstrating the power of the concept though!

      1. Thank you! Like you said this was more of a theory/concept post rather than a full fledged investing strategy. Having said that, because of the huge volatility swings in BTC, if we used limit orders we’d usually get filled before the day is out on the price we specify, thus being able to replicate the results pretty well. Trading daily in bitcoin actually seems like a pretty slow strategy in that sense, haha! 🙂

  3. Slippage on bitcoin and all cryptos is significant. That’s a big drawback for ensemble approaches. I doubt this strategy would succeed after transaction costs.

    1. Sure that might be true!, though rudimentary modeling of the transaction costs still yield a positive return even if it’s not as good. In any case, the post was more of using bitcoin as a use-case to exemplify the benefits of ensembles in strategy design. 🙂

Leave a Reply

Your email address will not be published.