Top

namespace anychart.math.macd Improve this Doc

Namespace anychart.math.macd
Learn more about indicator mathematics.

Functions Overview

calculate()MACD calculation.
calculationFunction()Calculates MACD.
createComputer()Creates a MACD computer for the given table mapping.
initContext()Creates a context for MACD indicator calculation.
startFunction()Start calculation function for MACD indicator calculation.

Typedefs Overview

anychart.math.macd.ContextType definition for the context.

Functions Description

calculate

MACD calculation.

Params:

Name Type Description
context anychart.math.macd.Context MACD context.
value number Value.

Returns:

Array.<number> - An array of the calculated MACD indicator values.

calculationFunction

Calculates MACD.

Params:

Name Type Description
row anychart.data.TableComputer.RowProxy Row proxy.
context anychart.math.macd.Context Context.

Try it:

createComputer

Creates a MACD computer for the given table mapping.

Params:

Name Type Description
mapping anychart.data.TableMapping Data mapping.
fastPeriod number Fast indicator period.
slowPeriod number Slow indicator period.
signalPeriod number Signal indicator period.

Returns:

anychart.data.TableComputer - Table computer.

Try it:

initContext

Creates a context for MACD indicator calculation.

Params:

Name Type Default Description
fastPeriod number
12
Fast indicator period.
slowPeriod number
26
Slow indicator period.
signalPeriod number
9
Signal indicator period.

Returns:

anychart.math.macd.Context - Context.

Try it:

startFunction

Start calculation function for MACD indicator calculation.

Params:

Name Type Description
context anychart.math.macd.Context Context.

Try it: