TTRtools {TTR} | R Documentation |
Various functions that may be useful in designing technical trading rules.
growth(price, signals, ...) lags(x, n=1) wilderSum(x, n=10)
price |
Price series to use. |
signals |
Signals to use (defaults to vector of ones). Use '0' for no position, '1' for long position, and '-1' for short position. |
x |
Object able to be coerced to a matrix. |
n |
Number of periods to use. |
... |
Further arguments to be passed from or to other methods. |
growth
calculates the growth of an investment using given prices and signals.
lags
calculates the lags of a given series.
wilderSum
calculates a Welles Wilder style weighted sum.
growth
returns a vector of the growth of the investment.
lags
returns a matrix of lagged values of the original vector.
wilderSum
returns a vector of weighted sums.
In growth
you can specify the number of periods and type of compounding
to use when calculating returns of the price series via the '...'
argument.
Josh Ulrich