Asset Management

Automating cryptocurrencies investment

T. Fuertes

16/06/2021

No Comments

Who has never heard about cryptocurrencies: Bitcoin, Ethereum, Cardano, or even the latest ones, such as Shiba or Safemoon? The investors are rapidly increasing their positions in those assets, although investing in them is usually a pain in the neck.

These assets have a high volatility and their movements don’t follow any traditional market rule and cryptocurrencies markets are not efficient. However, in this article you can learn how to automate investments in cryptocurrencies by using a well-known indicator: RSI.

RSI Indicator

Firstly, let’s introduce the RSI indicator. This metric allows you to know when a trend is about to end and when you should buy or sell, depending on the trend direction.

There are usually two thresholds: a maximum and a minimum, which typically are 70 and 30, respectively. These thresholds translate into the following rules:

  • If the RSI indicator is over the maximum threshold, 70, it’s time to sell because the uptrend is finishing and a downtrend is expected to come.
  • On the contrary, if the RSI indicator is under the minimum threshold, 30, it’s time to buy because the downtrend is finishing and an uptrend is supposed to come.

RSI needs to set a window to compute its value. The higher the window is, the more difficult it is to reach the maximum and minimum thresholds.

In the following image, there is an example with the Bitcoin price.

Example of how RSI works with Bitcoin cryptocurrency
How does RSI work with Bitcoin cryptocurrency?

Sometimes, there are two “sell” orders in a row, without any “buy” order in between. In this time, the indicator is reassuring a trend.

Automatic process with cryptocurrencies in practice

In this post, we’ll use 5 cryptocurrencies: Bitcoin (BTC), Ethereum (ETH), Cardano (ADA), Shiba (SHIB) and Safemoon (SAFEMOON).

The data used starts on 01-01-2018, excepting Shiba and Safemoon, which start on 14-05-2021 and 14-3-2021, respectively.

A rule based on a window of RSI

First of all, let’s define a simple rule based on the value of RSI with some predefined parameters: window equal to 6 days, maximum threshold equal to 90 and minimum threshold equal to 10.

  1. The first time we invest in a cryptocurrency is when its RSI is over 10.
  2. If RSI is over 90, we sell the cryptocurrency.
  3. If RSI is under 10, we buy the cryptocurrency .
  4. The weight is allocated equally between every cryptocurrency that is recommended to buy.
  5. If there is no currency available to invest, we keep money in cash (no invested).

In this test, we take into account a portfolio made up of Bitcoin, Ethereum and Cardano from 1-1-2018.

The performance of the portfolio shows that depending on when you invest, you can earn a great deal of money. However, when RSI fails the drawdown may be significant, like in 2018 or at the end of 2021.

It shows the result of investing in Bitcoin, Ethereum and Cardano based on RSI. It also appears the cryptocurrencies movements.
Result using RSI as indicator to invest in Bitcoin, Ethereum and Cardano.

A rule based on a cross of RSI indicators

As we’ve seen, the RSI indicator can fail individually, so we test another method to invest based on crossing RSI indicators. Now, we set two windows: a short one of 6 days and a long one of 24 days.

If the short RSI indicator (window equal to 6) is over the long RSI indicator (window equal to 24), it’s time to buy, and otherwise it’s time to sell.

Check how to sell or buy taking into account the cross of RSI indicators.
How to use a cross of RSI indicators

The rule of the methodology is as following:

  1. If the short RSI indicator is over the long RSI indicator, we buy the cryptocurrency.
  2. If the short RSI indicator is under the long RSI indicator, we sell the cryptocurrency.
  3. The weight is allocated equally between every currency that is recommended to buy.
  4. If there is no currency available to invest, we keep money in cash (no invested).
It shows the result of investing in Bitcoin, Ethereum and Cardano based on crossing two RSI indicators. It also appears the cryptocurrencies movements.
Result using a cross of RSIs as indicator to invest in Bitcoin, Ethereum and Cardano.

Now, the performance has improved compared with using a single RSI indicator because the methodology has detected the uptrends pretty well. However, the result has a high volatility, which is difficult to put up with if you’re risk averse.

Cryptocurrencies in fashion

There are some new cryptocurrencies that have recently started, and they did strongly. These are Shiba and Safemoon. The methodology that crosses two RSI indicators performs brightly taking into account that Shiba is in a constant downtrend.

Apply RSI cross with Shiba and Safemoon. It also appears the exposure.
Performance of RSI cross with Shiba and Safemoon

Conclusion

This methodology is made using Python in an easy way and it seems as if RSI works with cryptocurrencies. Do you dare invest?

0 Comments
Inline Feedbacks
View all comments