tema

Syntax

tema(X, window)

Please see TA-Lib Functions 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:

\(ema1 = ema(x, window)\)

\(ema2 = ema(ema1, window)\)

\(tema = 3 * ema1 - 3 * ema2 + ema(ema2, window)\)

Examples

$ x=12.1 12.2 12.6 12.8 11.9 11.6 11.2
$ tema(x,3);
[,,,,,,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