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.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
SMA
Indicator %K smoothing type.
dMATypeanychart.enums.MovingAverageType
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
"sma"
Indicator %K smoothing type.
dMATypeanychart.enums.MovingAverageType
"sma"
Indicator %D smoothing type.

startFunction

Start calculation function for Stochastic indicator calculation.

Params:

NameTypeDescription
contextanychart.math.stochastic.ContextContext.