Home/Dovee/Function reference

macdline

MACD line (fast EMA − slow EMA)

Reference/Oscillators/Function

macdline(source, fast, slow, signal)

Defaults close, 12, 26, 9. Short form macdline() or macdline(12, 26, 9) uses close. Sisters: macdsignal, macdhist.

Parameters

NameTypeDescription
sourceoptionalseries
default close
Series to use. Omit it when the first argument is a number — ema(9) means ema(close, 9).
fastoptionalint
default 12
Fast EMA.
slowoptionalint
default 26
Slow EMA.
signaloptionalint
default 9
Signal EMA of the MACD line.

Return value

series

Short form: if the first argument is a number, Dovee uses close as the source.

Example

oscillator
m = macdline()
s = macdsignal()
h = macdhist()
plot m as "MACD" blue
plot s as "Signal" orange
plot h as "Hist" gray
when m crosses above s then buy

See also