Calculation of the exponentially smoothed trend as a technical trading indicator.
Usage
trdes(y, lambda, init = NULL)
Arguments
y
Objects of classes: numeric, matrix, data.frame, ts, mts,
timeSeries, zoo and xts are supported.
lambda
Numeric, the smoothing parameter for $\lambda$ in
the equation below. The value for the parameter must be in the
interval $0 < \lambda < 1$.
init
The initial value in the recursive calculation of the
filter. Specifies the initial values of the time series just prior to
the start value, in reverse time order. The default, i.e.NULL, is a set of zeros.
Value
An object of the same class as y, containing the computed
exponetially smoothed values.
concept
Exponential Smoothing
Trend
ES Trend
Details
The exponetially smoothed trend is calculated according to the formula:
$$z_t = \lambda y_t + (1 - \lambda) * z_{t-1}$$