Skip to content
ChartRiderDocs

MACD

Moving Average Convergence Divergence: the difference of a fast and a slow EMA, its signal line and the histogram between them, with automatic divergence lines.

Updated ·Markdown

What you see

In its own pane: histogram bars (positive color above zero, negative color below), the MACD line and the signal line. The pane scales to the lowest and highest value of all three over the visible candles. Green and red lines mark divergences between price and the MACD line.

How it is calculated

  • A fast and a slow EMA of the close (EMA Fast Period, EMA Slow Period). Each starts with the simple average of its first N closes.
  • MACD = fast EMA − slow EMA, in price units.
  • Signal = EMA of the MACD line over Signal Period, starting with the simple average of its first values.
  • Histogram = MACD − Signal

Divergences use the MACD line with EMA Fast Period as the swing window and the same rules as the RSI.

How to read it

  • MACD above zero: the fast EMA is above the slow one, momentum points up. Below zero it points down.
  • The MACD crossing its signal line, which is the histogram changing sign, is the classic signal. Shrinking histogram bars show momentum fading before the cross.
  • Values are in price units, so their size depends on the market's price level.

Using it in strategies

Outputs: macd, signal, histogram, and value, which is also the MACD line. In the Trade Setup, "Compare" with histogram above 0 checks that the MACD is above its signal; as a trigger it fires when the histogram turns positive. "With" at center 0 on macd is a trend filter. In WickScript, m = macd(close, 12, 26, 9) gives m.line, m.signal and m.histogram; note that the built-in calls the MACD line line, while this indicator's output is macd. With use indicator "MACD" with fastPeriod 12, slowPeriod 26, signalPeriod 9 as md you read md.histogram and the other outputs.

Settings

Open the settings with the slider icon next to the indicator (Indicators, F3). Numeric settings can be swept as Step 1 / Step 2 parameters when you run a strategy.

Inputs

SettingTypeDefaultDescription
EMA Fast PeriodNumber12Period of the fast EMA. Also the swing window for divergence detection. (min 1)
EMA Slow PeriodNumber26Period of the slow EMA. (min 1)
Signal PeriodNumber9Period of the EMA that turns the MACD line into the signal line. (min 1)
HeightNumber50Height of the pane in pixels. (min 10)
Look Back RangeNumber2Candles after a swing point that are checked before the swing counts for a divergence. Higher values give fewer, later divergences. (min 1)

Styles

SettingTypeDefaultDescription
MACD Line ColorColor#1ca6bf
Signal Line ColorColor#d13570
Histogram Color PositiveColor#9ccd86
Histogram Color NegativeColor#fd4649

Outputs

These values can be used in Trade Setup triggers, filters and exits (see Trade Setup) and in WickScript.

OutputIn WickScriptDescription
valuevalueThe MACD line, the same as macd.
macdmacdFast EMA minus slow EMA.
signalsignalEMA of the MACD line.
histogramhistogramMACD line minus signal line.

Use in WickScript

use indicator creates this indicator inside a script, with settings by their ID. Each output is a field of the name after as. See WickScript indicators.

WickScript
wickscript 1
indicator "MACD from the list" in pane
use indicator "MACD" with fastPeriod 12 as myMacd
show myMacd.value as line "value"

Generated from the ChartRider source code on every release – settings, outputs and the WickScript reference always match the app.

Imprint·Privacy·Contact·Changelog·llms-full.txt

Paper trading uses play money only. Nothing in these docs is investment advice.