Class
caplin.chart.study

ExponentialMovingAverage

Implements caplin.chart.Study.
A study that calculates the exponential moving average over the given period.

This study requires the period to be passed in the derivation options.

This study only requires the configuration options defined by caplin.chart.Study.

This study is aliased by the caplin.chart-ema-study alias. To create a new instance of this study use the caplin.chart.study.Factory.

Constructor Summary

Attributes Name and Description
caplin.chart.study.ExponentialMovingAverage(String sAlias, Object mDerivationParams, Object oListener, Object mConfigOverrides)

Constructs a new caplin.chart.study.ExponentialMovingAverage.

Method Summary

Attributes Name and Description
void evaluate(Array pData)

Calculates the simple exponential average over the given period.

Methods implemented from class caplin.chart.Study:
enqueue, getAlias, getColor, getConfigValue, getDerivationParam, getDerivationParams, getDisplayName, getId, getRepresentationNames, getRepresentationTypes, serialize

Constructor Detail

caplin.chart.study.ExponentialMovingAverage(String sAlias, Object mDerivationParams, Object oListener, Object mConfigOverrides)

Constructs a new caplin.chart.study.ExponentialMovingAverage.

Parameters
String sAlias The Study alias.
Object mDerivationParams Study derivation options.
Object oListener A listener object that implements the caplin.chart.study.StudyListener interface.
Object mConfigOverrides (optional) Configuration overrides passed to the parent class. This study uses the default configuration options.

Method Detail

void evaluate(Array pData)

Calculates the simple exponential average over the given period.

Once completed it will invoke the caplin.chart.study.StudyListener#onStudyData method on it's listener.

The format of the calculated data is [[timestamp, value], ...].

Parameters
Array pData Chart series data in the Caplin Format.
See
caplin.chart.Study