Top
You are looking at an outdated 7.13.0 version of this document. Switch to the 7.14.3 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.

Try it:

Setter for the fast period.

Params:

Name Type Default Description
value number
12
Fast period.

Returns:

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

Try it:

histogramSeries

Getter for the current indicator histogram series.

Try it:

Setter for the indicator histogram series.

Params:

Name Type Default Description
type string | 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.

Try it:

macdSeries

Getter for the current indicator MACD series.

Returns:

anychart.core.stock.series.Base anychart.core.stock.scrollerSeries.Base - The current indicator MACD series.

Try it:

Setter for the indicator MACD series.

Params:

Name Type Default Description
type string | 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.

Try it:

signalPeriod

Getter for the current signal period.

Returns:

number - The current signal period.

Try it:

Setter for the signal period.

Params:

Name Type Default Description
value number
9
Signal period.

Returns:

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

Try it:

signalSeries

Getter for the current signal series.

Try it:

Setter for the signal series.

Params:

Name Type Default Description
type string | 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.

Try it:

slowPeriod

Getter for the current slow period.

Returns:

number - The current slow period.

Try it:

Getter and setter for the slow period.

Params:

Name Type Default Description
value number
26
Slow period.

Returns:

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

Try it: