Skip to main content

macd

Calculate the Moving Average Convergence Divergence (MACD).

Difference between two Exponential Moving Averages. The Signal line is an Exponential Moving Average of the MACD.

The MACD signals trend changes and indicates the start of new trend direction. High values indicate overbought conditions, low values indicate oversold conditions. Divergence with the price indicates an end to the current trend, especially if the MACD is at extreme high or low values. When the MACD line crosses above the signal line a buy signal is generated. When the MACD crosses below the signal line a sell signal is generated. To confirm the signal, the MACD should be above zero for a buy, and below zero for a sell.

Parameters

data: list[openbb_core.provider.abstract.data.Data]

list of data to be used for the calculation.

Optional: False


target: str

Target column name.

Default: close

Optional: True


fast: int

Number of periods for the fast EMA, by default 12.

Default: 12

Optional: True


slow: int

Number of periods for the slow EMA, by default 26.

Default: 26

Optional: True


signal: int

Number of periods for the signal EMA, by default 9.

Default: 9

Optional: True


index: str

Default: date

Optional: True


Returns

results: list[Data]

Serializable results.


provider: None

Provider name.


warnings: Optional[list[Warning_]]

list of warnings.


chart: Optional[Chart]

Chart object.


extra: dict[str, Any]

Extra info.


On this page