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

namespace anychart.math.sma Improve this Doc

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

Functions Overview

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

Typedefs Overview

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

Functions Description

calculate

SMA calculation.

Params:

NameTypeDescription
contextanychart.math.sma.ContextSMA context
valuenumberValue.

Returns:

number - The calculated SMA indicator value.

calculationFunction

Calculates SMA.

Params:

NameTypeDescription
rowanychart.data.TableComputer.RowProxyRow proxy.
contextanychart.math.sma.ContextContext.

createComputer

Creates a SMA computer for the given table mapping.

Params:

NameTypeDescription
mappinganychart.data.TableMappingData mapping.
periodnumberIndicator period.

Returns:

anychart.data.TableComputer - Table computer.

initContext

Creates a context for SMA indicator calculation.

Params:

NameTypeDefaultDescription
periodnumber
20
Indicator period.

Returns:

anychart.math.sma.Context - Context.

startFunction

Start calculation function for SMA indicator calculation.

Params:

NameTypeDescription
contextanychart.math.sma.ContextContext.