t3

语法

t3(X, window, [vfactor=1.0])

TA-lib 系列函数参数说明和窗口计算规则请参考: TA-lib 系列

参数

vfactor 是一个0-1之间的浮点数。 默认值是1.0。

详情

在给定长度(以元素个数衡量)的滑动窗口内,计算 X 的三重指数移动平均(Triple Exponential Moving Average)。

其计算公式为:

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

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

\(GD = (ema1 * (1+vfactor)) - (ema2 * vfactor)\)

\(t3 = GD (GD (GD(t, window, vfactor), window, vfactor), window, vfactor)\)

例子

$ x=12.1 12.2 12.6 12.8 11.9 11.6 11.2 16.9 55.6 5.6 3.3 66 6 57
$ t3(x, 3, 0.5);
[,,,,,,,,,,,,27.652790217144499,33.482904095904814]

$ x=matrix(12.1 12.2 12.6 12.8 11.9 11.6 11.2 15.7 18.6 13.2 19.6 20.3 22.4 11, 14 15 18 19 21 12 10 6 5.5 7 11 16 15 9.9)
$ t3(x, 3, 0.8);

col1

col2

20.9284

13.8993

18.3094

13.4915

相关函数:tema