Description Usage Arguments Value References 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 |

`tickers` |
Character vector of 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 ticker. |

`slopes` |
Numeric vector of values to multiply daily gains for each ticker by. Slopes are multiplied prior to adding intercepts. |

`...` |
Arguments to pass along with |

`tickers.gains` |
Numeric matrix of gains, where each column has gains for a particular fund. |

`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.

Ryan, J.A. and Ulrich, J.M. (2017) quantmod: Quantitative Financial Modelling Framework. R package version 0.4-12, https://CRAN.R-project.org/package=quantmod.

1 2 3 4 5 6 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.