t3
Syntax
t3(X, window, [vfactor=1.0])
Please see TALib for the parameters and windowing logic.
Details
Calculate the Triple Exponential Moving Average (t3) for X in a sliding window of the given length.
The formula is




DolphinDB t3 and TA-Lib T3 provide the same
functionality, but differ in the following aspects:
- Supported input types: DolphinDB
t3supports vectors, matrices, and tables as inputs, whereas TA-LibT3only supports one-dimensional arrays. - Default parameter values: The default value of the vfactor parameter is different between the two implementations.
- Missing value handling: The two implementations handle missing values
differently. For leading missing values, both preserve missing values at the
beginning of the series and start the window calculation from the first
non-missing value. For missing values that appear in the middle of the series,
DolphinDB
t3generally continues to calculate and return results according to its moving average rules, whereas TA-Lib may start returning NaN from that position onward for some indicators, affecting subsequent results.
Parameters
vfactor (optional) is a floating-point number in [0,1]. The default value is 1.0.
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 16.9 55.6 5.6 3.3 66 6 57
t3(x, 3, 0.5);
// output: [,,,,,,,,,,,,26.84,33.21]
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.76 | 13.47 |
| 18.24 | 13.24 |
Related function: tema
