rebal: Portfolio rebalance

Description Usage Arguments Details Value

View source: R/QuantAnalysis.R

Description

Portfolio rebalance

Usage

1
2
3
4
5
6
7
8
9
rebal(
  ret,
  ret_freq,
  wgt = NA,
  reb_freq = NA,
  date_start = NA,
  date_end = Sys.Date(),
  t_cost = 0
)

Arguments

ret

data.frame containing return time-series

ret_freq

character to represent frequency of ret

wgt

rebalance weights, see details

reb_freq

rebalance frequency, see detials

date_start

starting date to truncate portfolio returns

date_end

ending date to truncate portfolio returns

t_cost

optional numeric vector to specify transaction costs, see details

Details

The rebalance weight parameter wgt can be entered as a numeric vector of weights that correspond to each asset in ret or a data.frame containing a time-series of weights with dates in the first column similar to ret. If a numeric vector is entered reb_freq will specify how often the portfolio is rebalanced back to the target weights. If reb_freq is left as NA then a buy-and-hold strategy is assumed with no rebalances. If t_cost is a single value then it's assumed all assets have the same transaction cost. Otherwise a numeric vector that corresponds to each asset can be specified. Finally, note that if wgt is left as NA an equal weight portfolio will be assumed.

Value

list containing portfolio returns, asset returns, and asset weights


alejandro-sotolongo/InvestmentSuite documentation built on Jan. 19, 2020, 5:20 p.m.