AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated 7.14.3 version of this document. Switch to the 8.4.0 version to see the up to date information.

class anychart.core.stock.indicators.MACD Improve this Doc

Moving Average Convergence Divergence (MACD) indicator class. Learn more about the MACD indicator.

Methods Overview

Series
histogramSeries()Histogram series setting.
macdSeries()Indicator MACD series setting.
signalSeries()Signal series setting.
Specific Indicators Settings
fastPeriod()Fast period setting.
signalPeriod()Signal period setting.
slowPeriod()Slow period setting.

Methods Description

fastPeriod

Getter for the current fast period.

Returns:

number - The current fast period.
Setter for the fast period.

Params:

NameTypeDefaultDescription
valuenumber
12
Fast period.

Returns:

anychart.core.stock.indicators.MACD - Self instance for method chaining.

histogramSeries

Getter for the current indicator histogram series.
Setter for the indicator histogram series.

Params:

NameTypeDefaultDescription
typestring | anychart.enums.StockSeriesType
"column"
Type of the histogram series (type as "line", "column", "ohlc").

Returns:

anychart.core.stock.indicators.MACD - Self instance for method chaining.

macdSeries

Getter for the current indicator MACD series.

Returns:

anychart.core.stock.series.Base | anychart.core.stock.scrollerSeries.Base - The current indicator MACD series.
Setter for the indicator MACD series.

Params:

NameTypeDefaultDescription
typestring | anychart.enums.StockSeriesType
"line"
Type of the indicator MACD series (type as "line", "column", "ohlc").

Returns:

anychart.core.stock.indicators.MACD - Self instance for method chaining.

signalPeriod

Getter for the current signal period.

Returns:

number - The current signal period.
Setter for the signal period.

Params:

NameTypeDefaultDescription
valuenumber
9
Signal period.

Returns:

anychart.core.stock.indicators.MACD - Self instance for method chaining.

signalSeries

Getter for the current signal series.
Setter for the signal series.

Params:

NameTypeDefaultDescription
typestring | anychart.enums.StockSeriesType
"line"
Type of the signal series (type as "line", "column", "ohlc").

Returns:

anychart.core.stock.indicators.MACD - Self instance for method chaining.

slowPeriod

Getter for the current slow period.

Returns:

number - The current slow period.
Getter and setter for the slow period.

Params:

NameTypeDefaultDescription
valuenumber
26
Slow period.

Returns:

anychart.core.stock.indicators.MACD - Self instance for method chaining.