TTRtools: Miscellaneous Tools

Description Usage Arguments Details Value Note Author(s)

Description

Various functions that may be useful in designing technical trading rules.

Usage

1
2
3
4
5
  lags(x, n = 1)

  growth(price, signals, ...)

  naCheck(x, n = 0)

Arguments

price

Price series that is coercible to xts or matrix.

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 that is coercible to xts or matrix.

n

Number of periods to use.

...

Further arguments to be passed from or to other methods.

Details

growth calculates the growth of an investment using given prices and signals.

lags calculates the lags of a given series.

Value

growth returns a vector of the growth of the investment.

lags returns a matrix of lagged values of the original vector.

Note

In growth you can specify the number of periods and type of compounding to use when calculating returns of the price series via the '\dots' argument.

Author(s)

Joshua Ulrich


TTR documentation built on April 15, 2017, 8:31 a.m.

Related to TTRtools in TTR...