A strategy for trading ETH to make more BTC

Daniel Cimring
May 15, 2018 · 11 min read

First a confession. I’m a Bitcoin Maximalist. Well sort of. I’m a Maximalist in the sense that I believe Bitcoin has unique qualities and a unique position that makes it very well placed to become a new global non-sovereign store of wealth. I won’t go into all the reasons for this here. I’m a Maximalist in the sense that given Bitcoin’s unique position and it’s immaculate conception that anyone truly interested in seeing a new non-sovereign store of wealth come into being should focus their efforts on Bitcoin. I’m not a Maximalist in the sense that I believe there is no space in the crypto ecosystem for any other coins, nor in the sense that I believe Bitcoin’s destiny is inevitable. Things can change and if they do I would have to re-evaluate my postition.

Also Read: The Best Crypto Trading Bots

The simplest way for me to turn the above conviction about Bitcoin into an investment strategy is to buy and hold (i.e. HODL) for a long period of time (say 5 to 10 years). This sounds pretty easy but as I have written before HODLing can make you miserable. I fear I’m also hard wired to believe that if you’re not actively doing something then you’re slacking. So it’s hard to sit still and wait. Surely I can do something to improve on HODLing, after all I have 5 to 10 years and I can focus most of my attention on this task. This article is one attempt to do just that.

Twitter is a great place to stay up to date with the crypto ecosystem. In fact I think the killer app for Twitter is crypto. Crypto finally gave me a reason to use Twitter after being registered for years and not using it at all. Turns out Jack Dorsey (co-founder and CEO of Twitter) is also something of a Bitcoin Maximalist. So maybe there is a cosmic connection between Twitter and Bitcoin. In any event if you hang out on Twitter and follow a few crypto traders like I do, you will soon discover that lots of traders talk about trading ALTs (coins that aren’t bitcoin) in order to accumulate more bitcoin. This makes bitcoin something of a reserve currency and also a unit of account for the cyrpto market (or at least for many crypto traders). Incidentally this is one of the unique qualities of Bitcoin I referred to above. I decided to look at ethereum (ETH), the second largest cryptocurrency by market cap, to see if I could come up with a trading system for accumulating more bitcoin (BTC).

First let’s take a look at the chart for ETH priced in BTC and see if there are any patterns we can try and use. This data comes from the GDAX exchange and I downloaded it from Quandl. I’m using the daily close price (I discuss later on what daily close even means for an asset that trades 24/7).

ETH priced in BTC (data from GDAX)

It seems to move in broad trends, both up and down. Within each trend there are smaller ups and downs, and within those smaller ups and downs (fractal nature of price patterns), but the main trend continues for some time in each direction before turning around.

I’m thinking some sort of trend following or momentum strategy might work here. One very simple such strategy is to calculate a moving average (MA), and then to buy when the price crosses above the MA and sell (or go short) when it falls below the MA. For the rest of this article I will refer to this as the “MA Strategy”. I originally investigated using this type of MA Strategy for bitcoin itself, and will write about that another time.

A MA is simply an average over a particular number of days (could be 10 days, 20 days, 200 days or whatever). The number of days is called the lookback period, and it’s called a Moving Average because each day the average gets recalculated and so “moves”. If you are looking at a 10 day MA then each day you would look back at the past 10 days and calculate an average price. The next day there would be one new price to include in the average and the oldest price would drop off your calculation. This leads to the MA moving smoothely over time.

I took the price data from GDAX and split it exactly in half. The first half will be used to determine which MA lookback period works best (leads to the highest return). This part of the data is referred to as in sample or training data. The strategy can then be tested on the second half of the data to see how well it would have done. This part of the data is referred to as out of sample or test data. If the strategy does well on the training data but poorly on the test data then we know that it very likely won’t do well in the future either.

To find the optimal lookback period for the MA I wrote some Python code to try a range of lookback values and see which one resulted in the best returns over the training data period. Below is a summary of the results. The returns shown are returns in BTC and not USD. So a return of 84% means you earned 84% in BTC. The “Long only = False” part means the strategy can go short as well as long.

As you can see above using an 18 day MA results in a really good return over the training period, one that beats simply buying and holding ETH (which also did well over this period). Here’s a chart showing the price and the MA so you can visualise the buy and sell points. The green line is the MA and the orange line is the price.

Chart showing ETH price in BTC and 18 day MA

Now for the true test. How does the MA Strategy do over the test period which it was not optimised for. Below is a summary of the results.

So the 18 day MA worked really well on the test period too. That’s promising but bear in mind it’s still no guarantee that the strategy will work in the future. A bit later in the article I will try and determine how statistically significant these results are.

In order to compare the month by month returns for the MA Strategy versus the alternative of buy and hold, I created a heat map for the monthy returns. The total column on the far right of the heat map shows the return for each year, and the cells show returns for each month. Green shades indicate a positive return (the darker green the better), yellow shades show 0 or close to 0 return, and red shades show negative returns (the darker red the worse). Aug 2017 was the worst month with a -36% return. Mar 2017 was the best month with a 333% return. All 3 years had positive returns overall.

MA Strategy return heat map

Here as a comparison is the heatmap for buy and hold. 2016 was a negative 72% year, and 2018 did a lot worse than the MA strategy.

Buy and hold return heat map

Another way to compare the MA strategy to buy and hold is to look at the drawdowns for both. Here is a list of all drawdowns 20% or larger for both.

MA Strategy drawdowns
Buy and hold drawdowns

So both experience large drawdowns. The MA strategy drawdowns are less extreme (largest is 51% versus 81% for buy and hold) and recover a bit faster (rdays = number of days to recover to previous high). But the MA Strategy has more drawdowns over 20% (6 versus 4 for buy and hold). So even though the MA strategy can go both long and short as the trend changes, that does not mean you end up avoiding large drawdowns.

Finally here is a full comparison in USD returns between holding BTC, holding ETH, or using the MA Strategy over the test period. The MA Strategy was the clear winner.

An issue I mentioned above is whether these results are statistically significant. That is to say how likely is it that the results are really just due to chance and not due to the strategy. I tried 3 different approaches to this.

Hypothesis 1: The MA Strategy is really no different from buy and hold and we were just luckyHow to test: simulate buy the hold thousands and times and see how often buy and hold results in a return as good as the strategyProbability (p-value): 15.8%Hypothesis 2: The MA Strategy does not capture the serial correlations (trends) in pricesHow to test: simulate thousands of price series that have the same distribution as the real price series but where the returns each day are independent of each other. Apply our MA Strategy to these simulated prices and see how often it would beat the strategy return we got on the real prices.Probability (p-value): 6.3%Hypothesis 3: We were just lucky that our buy and sell decisions happened at fortunate timesHow to test: take the buy and sell decisions that the strategy made and place them instead at random dates. How often do these random buy and sells beat the results we got for the strategy.Probability (p-value): 5.7%

In order for our results to be statistically significant we are hoping to get a very low p-value, typically less than 1%. A p-value of 1% for example would imply that there is only a 1% chance our results are due to luck. Our p-values are 5% and higher which implies there is at least a 5% chance our good results are due to luck. This is not quite a “fail” but is not a clear “pass” either. I would classify it as inconclusive.

I’m not an actual trader, but would I trade this strategy. I think it’s promising but there is further work to do and things to consider:

  • Since the strategy is based on daily data which only starts around mid 2016 there is not much data to work with. The limited amount of data is one reason for the significance tests being inconclusive.
  • Do the results hold for other bitcoin exchanges. I repeated the exercise using data for Bitfinex which goes back a bit further than GDAX. The optimal MA for the training period was 22 days and the results were also very good for both the training and test periods (not quite as good as the GDAX results, but still good enough).
  • What about the same strategy but a “long only” version, meaning you sell when the price falls below the MA but you never go short. Not all exchanges allow you to go short, and there are additional risks and costs to do so. Doing the exercise over on this basis resulted in an optimal MA lookback period of 27 days. The results for the training period and the test period were still both very good (not quite as good as the version that goes short, but still good enough).
  • It will be interesting to try using intraday data (e.g. 30 minute resolution instead of daily). There might be more noise at this level, but there will be a lot more data points.
  • Maybe the 2016–2018 period was ETH’s settling in period and from now on these long trends will mostly be over and prices will be more mean-reverting or sideways than trending (i.e. a regime change). Remember that we are looking at ETH relative to BTC and not in USD. If the above is true then what worked in the past probably won’t work in the future.
  • Buy and hold doesn’t require you to leave funds on an exchange. Trading does. So by trading you are now taking exchange risk and could potentially lose everything if the exchange collapses. HODLers can secure their private keys and then relax on the beach or golf course without worrying about exchange risk.
  • Crypto trades 24/7 so the concept of a daily close price is not as clear cut as it is for stocks which trade business hours. Is the daily close price the last trade price on the exchange just before midnight, or is it the price at a particular time of the day. How this works might be different for different exchanges. I have ignored this is my analysis but it would need to be considered if you were running this strategy.
  • Perhaps the 18 day MA can just be used as a guide for discretionary trading instead of as a mechanical trading rule. Traders already use MA’s of various lengths to get a view on market trends. For example the 200 day MA is a popular way to determine whether you are in a bull or bear market that is used for many different markets including stocks and crypto. Maybe it makes sense to work out some coin specific MA’s as one among many trading tools.
  • Does the MA Strategy work on other ALT coins. For other large ALTs there is even less data, but so far this does look somewhat promising (although the statisical significance will be even worse given the limited data).
  • Maybe the bigger lesson here is that ALTs priced in BTC are more amenable to mechanical trading rules such as using moving averages. Traders often refer to ALT season which is when ALTs outperform BTC. In the past this has occured in on and off cycles.
  • My analysis so far excludes trading costs. The strategy did not trade very often (around 2 trades per month) so trading costs would have been relatively small.

If you enjoyed this article or got any benefit please clap (up to 50 times) so that others can find it too.

The Python code I wrote for this article is available on Github in the etherium.ipynb notebook.

Please note that nothing in this article should be taken as investment advice. Bitcoin and Ethereum are extremely volatile. Before investing please do your own research.

Also, Read

Get Best Software Deals Directly In Your Inbox

Coinmonks

Coinmonks is a non-profit Crypto educational publication.

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Daniel Cimring

Written by

BSc MBA. Worked in insurance, hotels & resorts, gaming. Founded a mobile SN in Africa. Bitcoin believer. Sound money maximalist. Enjoy tinkering in Python.

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store