# Moving Average Convergence/Divergence

## Contents

## Description

The **Moving Average Convergence/Divergence** is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price. The MACD is calculated by subtracting the 26-period Exponential Moving Average (EMA) from the 12-period EMA. The result of that calculation is the MACD line. A nine-day EMA of the MACD, called the "signal line", is then plotted on top of the MACD line which can function as a trigger for buy and sell signals.^{[1]}

## Syntax

## Inputs

**short**

Number of periods for the short EMA.

**long**

Number of periods for the long EMA.

**signal**

Number periods for the EMA of the MACD.

## Outputs

**MACD**

The Moving Average Convergence/Divergence.

**Signal line**

The pair used. Write it like this “EURUSD” and make sure the pair name matches exactly the name in MetaTrader.

**max**

The amount of ticks you want to list. Newest tick will be on top.