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

namespace anychart.math.kdj Improve this Doc

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

Functions Overview

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

Typedefs Overview

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

Functions Description

calculate

KDJ calculation.

Params:

NameTypeDescription
contextanychart.math.kdj.ContextKDJ context.
closenumberClose value.
highnumberHigh value.
lownumberLow value.

Returns:

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

calculationFunction

createComputer

Creates a KDJ computer for the given table mapping.

Params:

NameTypeDefaultDescription
mappinganychart.data.TableMapping
Data mapping.
kPeriodnumber
14
Indicator %K period.
kMAPeriodnumber
5
Indicator %K smoothing period.
dPeriodnumber
5
Indicator %D period.
kMATypeanychart.enums.MovingAverageType
EMA
Indicator %K smoothing type.
dMATypeanychart.enums.MovingAverageType
EMA
Indicator %D smoothing type.
kMultipliernumber
-2
The %K multiplier to calculate the % J values.
dMultipliernumber
3
The %D multiplier to calculate the % J values.

Returns:

anychart.data.TableComputer - Table computer.

initContext

Creates a context for KDJ indicator calculation.

Params:

NameTypeDefaultDescription
kPeriodnumber
14
Indicator %K period.
kMAPeriodnumber
5
Indicator %K smoothing period.
dPeriodnumber
3
Indicator %D period.
kMATypeanychart.enums.MovingAverageType
EMA
Indicator %K smoothing type.
dMATypeanychart.enums.MovingAverageType
EMA
Indicator %D smoothing type.
kMultipliernumber
-2
%K multiplier.
dMultipliernumber
3
%D multiplier.

Returns:

anychart.math.kdj.Context - Context.

startFunction

Start calculation function for KDJ indicator calculation.

Params:

NameTypeDescription
contextanychart.math.kdj.ContextContext.