Class
caplin.chart.study

MACD

A study that calculates the MACD technical analysis indicator.

This study requires the period (default 9, fasterPeriod (default 12) and slowerPeriod (default 26) to be passed in the derivation options. By default it will use the `close` field as the value for calculating the study data. If you require a different field, set a `field` property in the derivation options. See caplin.chart.series.Fields for details.

This study is aliased by the caplin.chart-macd-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.MACD(String sAlias, Object mDerivationParams, Object oListener, Object mConfigOverrides)

Constructs a new caplin.chart.study.MACD.

Method Summary

Attributes Name and Description
void evaluate(Array pData)

Calculates the MACD study over the given periods.

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

Constructor Detail

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

Constructs a new caplin.chart.study.MACD.

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 overrides the representationTypes, representationNames, isolate and colors options.

Method Detail

void evaluate(Array pData)

Calculates the MACD study over the given periods.

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

The format of the calculated data is: [[timestamp, macd, signal, histogram], ...]

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