cumulated {timeSeries} | R Documentation |
Compute cumulated financial series, e.g. prices or indexes, from financial returns.
cumulated(x, ...) ## Default S3 method: cumulated(x, method = c("continuous", "discrete", "compound", "simple"), percentage = FALSE, ...)
method |
a character string naming the method how the returns were computed. |
percentage |
a logical value. By default FALSE , if TRUE the
series will be expressed in percentage changes.
|
x |
an object of class timeSeries .
|
... |
arguments to be passed. |
all functions return a time series object of the same class as
the input argument x
.
## Load Microsoft Data - data(MSFT) setRmetricsOptions(myFinCenter = "GMT") MSFT <- MSFT[1:10, "Close"] MSFT ## Discrete Return Series - MSFT = 100 * MSFT/as.numeric(MSFT[1, 1]) MSFT.RET = returns(MSFT, method = "discrete") MSFT.RET ## Cumulative Series, Indexed to 100 - cumulated(MSFT.RET, method = "discrete")