exponentialMovingAverage
exponentialMovingAverage
Calculates the exponential moving average of values for the determined time.
Syntax
Each value corresponds to the determinate timeunit. The half-life x is the time lag at which the exponential weights decay by one-half. The function returns a weighted average: the older the time point, the less weight the corresponding value is considered to be.
Arguments
value— Value. Integer, Float or Decimal.timeunit— Timeunit. Integer, Float or Decimal. Timeunit is not timestamp (seconds), it's -- an index of the time interval. Can be calculated using intDiv.
Parameters
Returned values
- Returns an exponentially smoothed moving average of the values for the past
xtime at the latest point of time.
Type: Float64.
Examples
Input table:
Query:
Result:
Query:
Result: