# « Using the MACD to predict the price of Bitcoin

March 15, 2021 • ☕️ 3 min read

The MACD indicator is used to detect changes in the direction, momentum and duration of Bitcoin price trends.

The indicator is divided into three sub-indicators:

- The MACD itself
- The MACD signal
- The MACD divergence

## The MACD itself

This indicator is simply the difference between the following two price series:

- A fast moving exponential moving average of the Bitcoin price (fast EMA)
- A slow moving exponential moving average of the Bitcoin price (slow EMA)

## The MACD signal

This indicator is the exponential moving average (EMA) of the MACD itself.

## The MACD Divergence

This indicator is the difference between the MACD itself and the MACD signal.

## MACD parameters

The MACD takes 3 parameters:

- The time period of the fast Bitcoin EMA. This is usually set to 12.
- The time period of the slow Bitcoin EMA. This is usually set to 26.
- The time period of the signal EMA. This is usually set to 9.

The MACD is calculated from historical data (most often using the closing prices of Bitcoin candles).

## Usage of the MACD

#### Price Trend Detection

Faster EMA’s respond faster to new price trends than slower EMA’s.

By comparing a fast EMA to a slow EMA, one is capable of detecting changes to the overall price trend of Bitcoin.

More subtle changes to Bitcoin’s price trend can be detected by analyzing the MACD divergence (the difference between the MACD itself, and the MACD average). Analysts may need to correlate the MACD divergence with another indicator, such as the Relative Strength Index (RSI).

## MACD events

#### Signal line crossover

A signal crossover takes place when the MACD itself, and its exponentially moving average (the signal) cross each other.

A simple interpretation of the signal crossover is to go long on Bitcoin when the MACD crosses up, through the signal (bullish crossover), and to go short on Bitcoin when the MACD crosses below the signal (bearish crossover):

- MACD crosses above MACD signal: Go long on Bitcoin
- MACD crosses below MACD signal: Go short on Bitcoin

The abovementioned conditions can also be simplified to:

- MACD divergence goes from negative to positive: Go long on Bitcoin
- MACD divergence goes from positive to negative: Go short on Bitcoin

### Zero crossover

A zero crossover takes place when the MACD changes sign (goes from negative to positive, or positive to negative).

When the zero crossover takes place, there is no difference between the fast Bitcoin EMA and the slow Bitcoin EMA.

- A zero crossover that goes from negative to positive is considered bullish.
- A zero crossover that goes from positive to negative is considered bearish.

Thus, one would do the following:

- MACD crossing above 0: Go long on Bitcoin
- MACD crossing below 0: Go short on Bitcoin

#### Divergence

A MACD divergence event takes place when the price reaches a new low or high, but the MACD, itself, does not.

If the price reaches a new high, and the MACD does not, it’s called a Bearish divergence.

If the price reaches a new low, and the MACD does not, it’s called a Bullish divergence.

Thus, one would do the following:

If the Bitcoin price makes a new low, and the Bitcoin MACD does not: Go long on Bitcoin

If the Bitcoin price makes a new high, and the Bitcoin MACD does not: Go short on Bitcoin

## Duration

MACD’s with longer time periods are generally slower at detecting new price trends than MACD’s with shorter time periods.

However, there is a risk that shorter time period MACD’s only capture short-term price trends, and not longer term, intermediate price trends.

The duration can be varied either by changing the parameters, or by changing the time interval.

Mushino supports three different sets of parameters for the Bitcoin MACD, and 10 different time intervals.

## False positives

MACD signals may provide false positives - e.g. the price of Bitcoin goes up, even though a bearish crossover just took place.

A way to combat this might be to require that the crossover is a strong crossover - e.g. that the difference between the MACD and the MACD signal is at least X.

One can do this on Mushino by creating a strategy like this:

#### Strong bearish crossover

Go short when:

- MACD goes below (MACD signal - 5)

By applying an offset (-5) to the MACD signal, the chance of the crossover reversing becomes significantly smaller.