Description Usage Arguments Value Examples
Implements a trading strategy aimed at maintaining a fixed allocation to each of several funds, rebalancing when the effective allocations deviate too far from the targets.
1 2 3 4 5 6 7 8 9 10 11 |
tickers |
Character vector specifying 2 ticker symbols that Yahoo! Finance recognizes, if you want to download data on the fly. |
intercepts |
Numeric vector of values to add to daily gains for each fund. |
slopes |
Numeric vector of values to multiply daily gains for each fund by. Slopes are multiplied prior to adding intercepts. |
... |
Arguments to pass along with |
tickers.gains |
Data frame with one column of gains for each investment and a date variable named Date. |
target.alls |
Numeric vector specifying target allocations to each fund. If unspecified, equal allocations are used (e.g. 1/3, 1/3, 1/3 if there are 3 funds). |
tol |
Numeric value indicating how far the effective allocations can drift away from the targets before rebalancing. |
rebalance.cost |
Numeric value specifying total cost of each rebalancing trade. |
initial |
Numeric value specifying what value to scale initial prices to. |
List containing:
Numeric matrix named fund.balances
giving fund balances over
time.
Numeric value named rebalance.count
giving the number of
rebalancing trades executed.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.