Skip to content

MACD (Moving Average Convergence Divergence)

What it shows: the gap between a fast and a slow moving average of the close (the MACD line), plus a smoothed copy of it (the signal line). Above zero, the fast average is above the slow one.

How people use it: a MACD crossing above its signal line is a common buy signal that momentum is turning up; crossing below, a sell signal. MACD above zero is used as a filter that the trend is up.

Pairs well with: RSI (to avoid buying when the price already rose a lot) and a long moving average such as EMA 200 (to only take signals with the bigger trend).

Settings

Setting Default What it does
Fast 12 Length of the fast average. Shorter makes MACD react sooner (more, earlier crosses).
Slow 26 Length of the slow average. Longer makes MACD smoother and slower (fewer crosses). Must be larger than Fast.
Signal 9 Length of the signal line. Shorter follows MACD closely, so crosses come often; longer gives fewer, later crosses.

You set the defaults on the Indicators page. A condition can use its own settings, which override the defaults for that condition only.

Ready-made conditions

For Condition Fires when
Buy MACD crosses above signal the one candle MACD moves from below the Signal line to above it
Buy MACD above zero every candle MACD is above 0
Sell MACD crosses below signal the one candle MACD moves from above the Signal line to below it
Sell MACD below zero every candle MACD is below 0

"Above", "below", "is" and "rising" / "falling" stay true on every candle the state lasts, so they can fire many candles in a row. "Crosses" and "flips" fire once, on the candle it happens, so you get one signal per move.

Warnings you may see

  • "It compares a line with itself (same indicator, same settings), so it can never fire. Give the two lines different settings.": both sides of the condition are the very same line. Pick a different line or different settings for one side. With ">=", "<=", "==" or "touches" the message ends "so it is always true" instead.
  • "It can never be true: a cross happens on one candle, so it cannot happen on N candles in a row. Use 'within the last N candles' instead.": a "crosses" condition with a "… in a row" lookback of 2 or more. Switch the lookback to Within the last.
  • "Fast must be between 1 and 1000" / "Fast must be a whole number": shown in the condition editor when a condition's own value is out of range. Fix the number; the condition can't be saved until then.
  • "Slow must be between 1 and 1000" / "Slow must be a whole number": shown in the condition editor when a condition's own value is out of range. Fix the number; the condition can't be saved until then.
  • "Signal must be between 1 and 1000" / "Signal must be a whole number": shown in the condition editor when a condition's own value is out of range. Fix the number; the condition can't be saved until then.
  • "Fast must be smaller than Slow": in a condition, Fast has to stay below Slow.

Where they show: on the Strategies page, open Create entry conditions / Edit entry conditions (or the exit ones). Each condition's messages appear right under it. The setting messages ("must be between", "whole number", "must be one of", "must be smaller than") start with the indicator's short name, for example "MACD: Fast must be between 1 and 1000", and keep the conditions from being saved until fixed. The other warnings never block saving and are repeated in the strategy's Entry or Exit section, starting with the condition's name.

Good to know

  • It is worked out from closing prices only (not volume).
  • On 1m or 5m candles MACD crosses its signal very often; most of these are noise.
  • It needs some history before its value settles: 3 × (Slow + Signal) candles (105 at 12 / 26 / 9). Apathia loads that history for you.