View source: R/constant_weights.R
constant_weights | R Documentation |
constant_weights
applies the identity function to the default weights
in a strategy.
constant_weights(strat, reb_date = NULL, P, R, risk_free)
strat |
A list representing an asset allocation strategy. |
reb_date |
A date on which the allocation rule is applied. |
P |
An xts object with daily prices of the tickers in strat. |
R |
An xts object with daily returns of the tickers in strat. |
risk_free |
Either an xts object with daily returns of the risk-free asset, or a scalar numeric with the annual risk-free rate in decimals. |
A numeric vector of weights after applying the rule.
us_60_40 <- asset_allocations$static$us_60_40
reb_date <- as.Date("2022-03-31")
constant_weights(us_60_40,
reb_date,
ETFs$Prices[, us_60_40$tickers],
ETFs$Returns[, us_60_40$tickers],
ETFs$risk_free)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.