tripleEMA() function
The tripleEMA()
function calculates the exponential moving average of values in
the _value
column grouped into n
number of points, giving more weight to recent
data with less lag than
exponentialMovingAverage()
and doubleEMA()
.
tripleEMA(n: 5)
Triple exponential moving average rules
- A triple exponential moving average is defined as
tripleEMA = (3 * EMA_1) - (3 * EMA_2) + EMA_3
.EMA_1
is the exponential moving average of the original data.EMA_2
is the exponential moving average ofEMA_1
.EMA_3
is the exponential moving average ofEMA_2
.
- A true triple exponential moving average requires at least requires at least
3 * n - 2
values. If not enough values exist to calculate the triple EMA, it returns aNaN
value. tripleEMA()
inherits all exponential moving average rules.
Parameters
n
(Required) Number of points to average.
tables
Input data.
Default is piped-forward data (<-
).
Examples
The following example uses data provided by the sampledata
package
to show how tripleEMA()
transforms data.
Calculate a three point triple exponential moving average
import "sampledata"
sampledata.int()
|> tripleEMA(n: 3)
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.