# backtest asset allocation strategies

I've searched the site but haven't found an easy way to backtest my personal portfolio allocations. Suppose I want to know the total return for the following portfolio from Jan 1, 2009 to Dec 31, 2014:

25% VINIX
25% VSMAX
25% VTMGX
25% VTRIX


I'm interested in total returns (distributions reinvested). It would be useful to model rebalancing strategies based on time (i.e. yearly) or by percentage drift from allocation. I'm agnostic as to programming language (python, R, ruby, etc.) but am looking for a basic library to test returns under a variety of such assumptions, ideally with good documentation/examples.

• I suggest you try SIT library from R (systematicinvestor.github.io / github.com/systematicinvestor/SIT ) that was specifically developed for backtesting tactical asset allocation or quantstrat also from R which is more geared towards trading. – Sergey Bushmanov Mar 7 '16 at 9:19
• Thanks for the tip. I'll get started with these. My initial impression is that these are powerful tools and the learning curve for these is a bit higher than I was looking for, but I appreciate this nonetheless. – Stephen Grimes Mar 7 '16 at 18:08
• You might try portfoliovisualizer.com/backtest-portfolio it looks promising, I have never really used it TBH – noob2 Mar 8 '16 at 13:52
• With R you could use getSymbols from the quantmod package to get historic price data from Yahoo. You should use Adjusted Prices as these included dividends and distributions. The PerformanceAnalytics package could then be used to calculate asset and portfolio returns including rebalancing. Both of these packages are documented and have examples. – WaltS Mar 8 '16 at 14:44
• Thanks WaltS, the quantmod and PerformanceAnalytics packages look promising. The portfoliovisualizer.com site is also helpful and does most of what I'm looking for, but I'd just like to be able to write it in code to make modifications as needed. – Stephen Grimes Mar 8 '16 at 16:28