namespace anychart.math.trix Improve this Doc
Namespace anychart.math.trix
Learn more about indicator mathematics.
Functions Overview
| calculate() | TRIX calculation. | 
| calculationFunction() | Calculates TRIX. | 
| createComputer() | Creates TRIX computer for the given table mapping. | 
| initContext() | Creates context for TRIX indicator calculation. | 
| startFunction() | Start calculation function for TRIX indicator calculation. | 
Typedefs Overview
| anychart.math.trix.Context | Type definition for the context. | 
Functions Description
calculate
TRIX calculation.
 Detailed description
Calculates next TRIX value based on a previous Ma value and current data value.
To use this function you need a setup queue with a length equal to the period.
For the first calculation pass NaN or nothing as a opt_prevResult.
To use this function you need a setup queue with a length equal to the period.
For the first calculation pass NaN or nothing as a opt_prevResult.
Params:
| Name | Type | Description | 
|---|---|---|
| context | anychart.math.trix.Context | Context. | 
| value | number | Value. | 
Returns:
Array.<number> - The calculated TRIX indicator array of values.calculationFunction
Calculates TRIX.
Params:
| Name | Type | Description | 
|---|---|---|
| row | anychart.data.TableComputer.RowProxy | Row proxy. | 
| context | anychart.math.trix.Context | Context. | 
Try it:
createComputer
Creates TRIX computer for the given table mapping.
Params:
| Name | Type | Default | Description | 
|---|---|---|---|
| mapping | anychart.data.TableMapping | Data mapping. | |
| period | number | 15 | Moving Average period. | 
| signalPeriod | number | 9 | Signal Moving Average period. | 
| maType | string | anychart.enums.MovingAverageType | 'ema' | Indicator smoothing type. | 
| signalMaType | string | anychart.enums.MovingAverageType | 'ema' | Signal smoothing type. | 
Returns:
anychart.data.TableComputer - Table computer.Try it:
initContext
Creates context for TRIX indicator calculation.
Params:
| Name | Type | Default | Description | 
|---|---|---|---|
| period | number | 15 | Indicator period. | 
| signalPeriod | number | 9 | Signal indicator period. | 
| maType | string | anychart.enums.MovingAverageType | 'ema' | Indicator smoothing type. | 
| signalMaType | string | anychart.enums.MovingAverageType | 'ema' | Signal smoothing type. | 
Returns:
anychart.math.trix.Context - Context.Try it:
startFunction
Start calculation function for TRIX indicator calculation.
Params:
| Name | Type | Description | 
|---|---|---|
| context | anychart.math.trix.Context | Context. | 
Try it:
