AnyChart
API Reference
Still have questions?
Contact support
Top

namespace anychart.math.stochastic Improve this Doc

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

Functions Overview

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

Typedefs Overview

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

Functions Description

calculate

Stochastic calculation.

Params:

NameTypeDescription
contextObjectStochastic context.
closeValuenumberClose value.
highValuenumberHigh value.
lowValuenumberLow value.

Returns:

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

calculationFunction

createComputer

Creates a Stochastic computer for the given table mapping.

Params:

NameTypeDefaultDescription
mappinganychart.data.TableMapping
Data mapping.
kPeriodnumber
14
Indicator %K period.
kMAPeriodnumber
1
Indicator %K smoothing period.
dPeriodnumber
3
Indicator %D period.
kMATypeanychart.enums.MovingAverageType | string
SMA
Indicator %K smoothing type.
dMATypeanychart.enums.MovingAverageType | string
SMA
Indicator %D smoothing type.

Returns:

anychart.data.TableComputer - Table computer.

initContext

Creates a context for Stochastic indicator calculation.

Params:

NameTypeDefaultDescription
kPeriodnumber
14
Indicator %K period.
kMAPeriodnumber
1
Indicator %K smoothing period.
dPeriodnumber
3
Indicator D period. Defaults to 3.
kMATypeanychart.enums.MovingAverageType | string
"sma"
Indicator %K smoothing type.
dMATypeanychart.enums.MovingAverageType | string
"sma"
Indicator %D smoothing type.

startFunction

Start calculation function for Stochastic indicator calculation.

Params:

NameTypeDescription
contextanychart.math.stochastic.ContextContext.