This study requires the period
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 only requires the configuration options defined by caplin.chart.Study.
This study is aliased by the caplin.chart-sma-study
alias. To create a new instance of this study
use the caplin.chart.study.Factory.
Attributes | Name and Description |
---|---|
|
caplin.chart.study.SimpleMovingAverage(String alias, Object derivationParams, Object listener, Object configOverrides)
Constructs a new |
Attributes | Name and Description |
---|---|
|
void
evaluate(Array data)
Calculates the simple moving average over the given period. |
►
caplin.chart.study.SimpleMovingAverage(String alias, Object derivationParams, Object listener, Object configOverrides)
Constructs a new caplin.chart.study.SimpleMovingAverage
.
String | alias | The Study alias. |
Object | derivationParams | Study derivation options. |
Object | listener | A listener object that implements the caplin.chart.study.StudyListener interface. |
Object | configOverrides | (optional) Configuration overrides passed to the parent class. This study uses the default configuration options. |
►
void
evaluate(Array data)
Calculates the simple moving average over the given period.
Once completed it will invoke the caplin.chart.study.StudyListener#onStudyData method on its listener.
The format of the calculated data is: [[timestamp, value(, state)], ...]
Array | data | Chart series data in the Caplin Format. |