Using Moving Average Cross-Over as strategy in cryptocurrency trading (2024)

Abstract

In trading, we often tend to rely upon over-complicated strategies that over promise gains and undermine risks. However, the key to find a balanced trading strategy is simplicity. In this article, we present a systematic back-testing of a well-known, simple yet profitable strategy called Moving Average Cross Over (MACO) in the trading of the top-18 cryptocurrencies. In our study, we screen for the best combination of short-term and long-term moving averages and we set the basis for a potentially automatic strategy. MACO with optimal parameters reports (a) more than 50% profit over investment in 10 out of 18 cryptocurrencies, (b) more than 100% USD return (no value loss) in 16 out of 18 cryptos and (c) better performance than “holding” in 17 out of 18 cases.

The MACO strategy

The moving average cross over trading strategy is fairly simple. We calculate two different moving averages (MA): one long and one short. The long one, or long-termed, represents the overall trend of the market: either bullish (when it goes up) or bearish (when it goes down). The short one, or short-termed, represents the more immediate price fluctuation and reacts quicker when the price changes. Now, when the fast MA crosses the slow MA we detect a potential change of trend. As traders, we can leverage the detected change of trend and buy when the trend becomes bullish, and sell when the trend becomes bearish. These concepts are represented in the following example for the BTC-USDT trading pair.

Also Read: Best Crypto Trading Bots

Using Moving Average Cross-Over as strategy in cryptocurrency trading (3)

In the previous example, we buy when the fast MA goes over the slow MA (green area) and we sell when the fast MA goes under the slow MA (red area). So far so good.

MACO performance on successive trading windows

As we saw in the previous example, MACO is quite simple to apply in appearance. In practice is a little bit more complicated because we have to find a successful combination of lengths for the short and long moving averages. One way we can address this issue in retrospective is by trying all or a representative set of combinations and see which ones performed better on past data (a.k.a. back-testing).

There are different ways to assess the performance of each short/long MA combination. For this analysis, we have decided to take windows of 20 days (20*6 candles of 4h) and moving them along the time axis in jumps of 4 days (4*6 candles of 4h). For each window, we calculated:

(a) The return over investment following the aforementioned MACO strategy to buy and sell according to the cross-overs and the cross-unders, respectively.

(b) The return over investment by following a “holding” strategy, i.e. buying at the beginning of the window and selling in the end of the window.

The ratio between the two (MACO/holding) was computed for each window and for each combination of long-term MA (20, 30, 40, 50, 60, 70 candles of 4h) and and short-term MA (1, 2, 3, 4, 5, 6, 7, 8, 9 candles of 4h). The results for the BTC-USDT pair look like this:

Using Moving Average Cross-Over as strategy in cryptocurrency trading (4)

The lines/simulations that go over 1 mean that MACO strategy was, for instance, 1.2 (20%) more profitable than just holding for that particular window. The legend on the right show all combinations of long/short MA (first parenthesis). The price of BTC is shown as reference.

Although all combinations of long/short MA seem to follow a similar pattern, there are clearly some winners and some losers. In order to discriminate the best strategy, we have calculated the area under the curve (AUC) above 1 (positive AUC) and the area under the curve below 1 (negative AUC). Finally, the profitability of a specific combination of MAs can be calculated as:

Total_AUC = MA_positive - MA_negative

A positive total AUC means that following the MACO strategy is better than holding on average. The winner combination of short/long MA with maximum total AUC is depicted in red. Individual total AUCs can be found on the legend.

Two final remarks. First, notice that each simulation or predicted return has an associated error bar. This is because, to make it more realistic, once the strategy tells us to buy or sell, we use a random price comprised between the open and close of the following candle. Additionally, for each buy/sell action we take into account a 0.1% commission.

Second, notice that no combination is particularly profitable during exponential growths such as the one that BTC experienced in late 2017. In these situations, holding is clearly the best strategy to follow. Notice, however, that when markets enter a side-ways or bearish trend, trading becomes a handy tool to maximize profits by hedging on downtrends. This becomes even more evident in the following plots shown in this article.

Screening profitable MACO long/short combinations among the top-18 cryptocurrencies

In this final analysis, we applied the techniques explained in the previous sections to the top 18 cryptocurrencies by volume in the Binance cryptocurrency exchange. In particular, we ran the previous analysis to detect the best and worst long/short MA combination and we ran 1000 different simulations following the MACO strategy to buy and sell cryptocurrency during the duration of one year using 4h candlesticks. These are the results:

Using Moving Average Cross-Over as strategy in cryptocurrency trading (5)

From the plots we can conclude that MACO with optimal parameters yield:

(a) more than 50% profit over investment in 10 out of 18 cryptocurrencies,

(b) more than 100% USD return (no value loss) in 16 out of 18 cryptos (this means that trading is good to hedge funds in downtrends) and

(c) better performance than “holding” in 17 out of 18 cases.

Finally, the best performing cryptocurrency pair has been the ZRXBTC pair with over 800% on returns. Interestingly, the top 3 cryptocurrencies were also particularly profitable.

Conclusions and personal opinion

  • Moving average cross over is a simple yet profitable strategy to follow.
  • Using back-testing to see which was the profitable combination of long/short MA gives us a good idea on what worked in the past and what could work in the future, but with little guarantee.
  • MACO strategy can be used to trade cryptocurrencies but would probably work optimally when in combination to other indicators. I personally use price action as confirming indicator.
  • MACO seems to work quite well for the current top 3 cryptocurrencies (BTC, ETH, XRP).
  • Trading with a solid strategy in hand is a good practice in all occasions except during meteoric and parabolic growths.

This project is part of our research at CryptoDatum.io, a cryptocurrency data API that aims to provide plug-and-play datasets to train machine learning algorithms. If you liked the data we showed in this article, get your free API key and play with it yourself at https://cryptodatum.io

Using Moving Average Cross-Over as strategy in cryptocurrency trading (6)

Also, Read

  • The Best Crypto Trading Bots
  • Deribit Review | Options, Fees, APIs and Testnet
  • FTX Crypto Exchange Review
  • The Best Bitcoin Hardware wallet
  • Crypto Copy Trading Platforms
  • The Best Crypto Tax Software
  • Best Crypto Trading Platforms
  • Best Crypto Lending Platforms
  • Ledger vs Trezor
  • Bitsgap review — A Crypto Trading Bot That Makes Easy Money
  • Quadency Review- A Crypto Trading Bot Made For Professionals
  • PrimeXBT Review | Leverage Trading, Fee and Covesting
  • HaasOnline Review and Get a 10% discount
  • The Idiots Guide to Margin Trading on Bitmex
  • eToro Review | Trade Stocks, Crypto, ETFs, CFDs, and commodities
  • Bitmex Advanced Margin Trading Guide
  • Best Crypto APIs for Developers
  • Crypto arbitrage guide: How to make money as a beginner
  • Top Bitcoin Node Providers
  • Best Crypto Charting Tool
  • What are the best books to learn about Bitcoin?

Get Best Software Deals Directly In Your Inbox

Using Moving Average Cross-Over as strategy in cryptocurrency trading (7)
Using Moving Average Cross-Over as strategy in cryptocurrency trading (2024)
Top Articles
Latest Posts
Article information

Author: Chrissy Homenick

Last Updated:

Views: 6287

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Chrissy Homenick

Birthday: 2001-10-22

Address: 611 Kuhn Oval, Feltonbury, NY 02783-3818

Phone: +96619177651654

Job: Mining Representative

Hobby: amateur radio, Sculling, Knife making, Gardening, Watching movies, Gunsmithing, Video gaming

Introduction: My name is Chrissy Homenick, I am a tender, funny, determined, tender, glorious, fancy, enthusiastic person who loves writing and wants to share my knowledge and understanding with you.