MACD

All functions · nseries package

MACD

func (s Series) MACD(fastLen, slowLen int) Series

MACD returns the Moving Average Convergence/ Divergence of a fast and slow EMA.

Bars 0 to fastLen-2 are exactly 0, because both averages pass the input through, so their difference is 0; bars fastLen-1 to slowLen-2 are XAverage(fastLen) - s, not a true MACD; the first full value is at slowLen-1.