Moving Average Convergence/Divergence
MACD is a trend-following momentum indicator that shows the relationship between two EMAs.
Method
Inputs
Parameter | Argument type | Description | Default Value |
---|---|---|---|
source | pd.Series | Input data series | - |
fastperiod | int | Fast period for the indicator | 12 |
slowperiod | int | Slow period for the indicator | 26 |
signalperiod | int | Signal period for the indicator | 9 |
Outputs
The outputs are returned as a tuple of objects. Make sure to unpack them as shown in the example usage.
Output | Type |
---|---|
macd | np.ndarray |
macdsignal | np.ndarray |
macdhist | np.ndarray |