rebalance: Periodic portfolio rebalance to a given set of weights

Description Usage Arguments Value

Description

Periodically rebalances a portfolio to a set of weights according to a weight vector.

Usage

1
rebalance(prices, weights, on = "months", rebal_offset = 1)

Arguments

prices

An xts of asset prices from which to build the equity curve using periodic rebalancing.

weights

A list or vector of asset symbols with their associated weights. This vector should normally sum up to one. However, what matters is the relative ratios between each weight, not the absolute values. The list or vector must be named, and each name must have a corresponding column in the prices xts matrix.

on

Period on which to rebalance using function endpoints. Valid values are: 'weeks', 'months', 'quarters', 'years' .

rebal_offset

Number of days from which to offset the rebalance. Default is one, which corresponds to the day after the period endpoints. Can only be zero or a positive number (which rebalances later than the endpoint).

Value

An xts matrix of the portfolio equity curve, rebalanced at the end of the specified trading day by argument on. The first column contains the prices equity curve while the second column contains the daily returns of the equity curve.


jeanmarcgp/xtsanalytics documentation built on May 19, 2019, 12:38 a.m.