tema

Syntax

tema(X, window)

Please see TALib for the parameters and windowing logic.

Details

Calculate the Triple Exponential Moving Average (tema) for X in a sliding window of the given length.

The formula is:

Difference from Python TA-Lib's TEMA: Both functions calculate the Triple Exponential Moving Average. TA-Lib's TEMA is an Overlap Studies indicator whose timeperiod parameter defaults to 30; its close input and output are primarily one-dimensional arrays. DolphinDB's tema uses the required window parameter for the window length, accepts a vector, matrix, or table, returns the same data form as X, and uses NULL for unfilled windows.

Returns

DOUBLE type with the same data form as X.

Examples

x=12.1 12.2 12.6 12.8 11.9 11.6 11.2
tema(x,3);
// output: [,,,,,,11.24444444444444]

x=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2, 14 15 18 19 21 12 10)
tema(x,3);
col1 col2
11.2444 10.6296

Related functions: ema, dema