MACD

macdoscillatorsForge API 1

The gap between a fast and a slow EMA, with a signal line and histogram.

Inputs

NameTypeDefaultRange
sourcesourceclose
fast_periodint121 to 5000
slow_periodint261 to 5000
signal_periodint91 to 5000

Outputs

NameTypeRequiredDescription
macdvalueOptionalcolor theme.series_a, style line, width 1
signalvalueOptionalcolor theme.series_b, dash dash, style line, width 1
histogramvalueOptionalcolor theme.accent, color_down theme.down, color_up theme.up, style histogram
Warm-up
max(fast_period, slow_period) + signal_period - 2 bars (33 at the defaults)
Repaints
No
Parity
MetaTrader 5, within 1e-12

Formula

MACD = EMA(source, fast_period) - EMA(source, slow_period), both seeded on the first value

signal = the simple average of MACD over signal_period, as MetaTrader 5 computes it

histogram = MACD - signal