Description Usage Arguments Details Value Author(s) References Examples
Computes multiple flavors of the moving average.
1 |
price |
A vector of past prices or an equivalent xts object. |
period |
Integer or vector/list of integers. Number of datapoints over which calculate the average. |
method |
One of |
weight |
The vector of weights to assign to the weighted moving
average. If |
k |
Weighting multiplier for the EMA. If |
The weighted moving average method (WMA) is a bit trickier to handle because
it requires an input (weight) that is functional of the value an other
(period). If no weights are provided, then they are automatically assigned
linearly, e.g. 1/55, 2/55, ..., 10/55
with 10 periods.
If period
has more than 1 value, then user weight
is ignored
and Linearly Weighted Moving Average (LWMA
) is computed.
For EMA the parameter period
is the time span over which calculate
the initial point average.
A vector or an xts
object,
accordingly to the input, of the same length of the input.
The first period-1 values are NA.
Giovanni Kraushaar <giovanni.kraushaar@usi.ch>
Murphy John J. (1999), Technical Analysis of the Financial Markets, New York Institute of Finance.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.