Skip to main content

MACD

Type: macd • Category: indicators

Description

Calculates MACD indicator based on closing price list

Parameters

NameTypeDescriptionRequiredDefault
dataExpstringselect the column with closing pricesno
pricestringPrice field to use to calculate MACDno
fastperiodnumberNumber of periods for the fast EMAno12
slowperiodnumberNumber of periods for the slow EMAno26
signalperiodnumberNumber of periods for the signal lineno9

Help

MACD Indicator Worker

=====================================

Description


The MACD (Moving Average Convergence Divergence) indicator worker is a financial analysis tool used to identify trends and predict potential buy and sell signals. This worker calculates the MACD indicator based on a list of closing prices.

What does this worker do?


The MACD worker takes in a column of closing prices and calculates three main components:

  • MACD Line: The difference between two exponential moving averages (fast and slow) of the closing prices.
  • Signal Line: A moving average of the MACD line.
  • Histogram: The difference between the MACD line and the signal line.

How to interpret the results


The MACD indicator can be interpreted in several ways:

  • Crossovers: When the MACD line crosses above the signal line, it's a bullish signal (buy). When the MACD line crosses below the signal line, it's a bearish signal (sell).
  • Divergences: When the MACD line and the price chart show different trends, it can indicate a potential reversal.
  • Histogram: A growing histogram indicates increasing momentum, while a shrinking histogram indicates decreasing momentum.

Parameters


The MACD worker accepts the following parameters:

  • dataExp: Select the column with closing prices.
  • price: Price field to use to calculate MACD.
  • fastperiod: Number of periods for the fast EMA (default is 12).
  • slowperiod: Number of periods for the slow EMA (default is 26).
  • signalperiod: Number of periods for the signal line (default is 9).

Usage


To use the MACD worker, simply provide the required parameters and a list of closing prices. The worker will output the MACD line, signal line, and histogram.

Example Use Cases

  • Trend identification: Use the MACD worker to identify trends in a stock's closing prices.
  • Buy and sell signals: Use the MACD worker to generate buy and sell signals based on crossovers and divergences.

Visualizing the MACD Indicator


For a visual representation of how to use the MACD worker, refer to the following GIFs:

Full GIF

[![Full GIF](https://pub-6c7cc7f707d94ca98153d59a039b9a3d.r2.dev/indicator_full.gif)](https://pub-6c7cc7f707d94ca98153d59a039b9a3d.r2.dev/indicator_full.gif)

Short GIF

[![Short GIF](https://pub-6c7cc7f707d94ca98153d59a039b9a3d.r2.dev/indicator_short.gif)](https://pub-6c7cc7f707d94ca98153d59a039b9a3d.r2.dev/indicator_short.gif)

Additional Information


The MACD indicator was developed by Gerald Appel in the 1970s. It's a popular technical analysis tool used to identify trends, predict potential buy and sell signals, and gauge momentum. The MACD indicator can be used in various markets, including stocks, forex, and cryptocurrencies.