AnyChart
API Reference
Still have questions?
Contact support
Top

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 instance.
macdSeries()Indicator MACD series instance.
signalSeries()Signal series instance.
Specific Indicators Settings
fastPeriod()Fast period setting.
signalPeriod()Signal period setting.
slowPeriod()Slow period setting.

Methods Description

fastPeriod

Getter for the 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 indicator histogram series instance.

Try it:

Setter for the indicator histogram series type.

Params:

Name Type Description
type anychart.enums.StockSeriesType | string 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 instance.

Returns:

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

Try it:

Setter for the indicator MACD series type.

Params:

Name Type Description
type anychart.enums.StockSeriesType | string 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 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 signal series instance.

Try it:

Setter for the signal series type.

Params:

Name Type Description
type anychart.enums.StockSeriesType | string 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 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: