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:


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.

  • $\begingroup$ 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. $\endgroup$ – Sergey Bushmanov Mar 7 '16 at 9:19
  • $\begingroup$ 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. $\endgroup$ – Stephen Grimes Mar 7 '16 at 18:08
  • $\begingroup$ You might try portfoliovisualizer.com/backtest-portfolio it looks promising, I have never really used it TBH $\endgroup$ – noob2 Mar 8 '16 at 13:52
  • $\begingroup$ 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. $\endgroup$ – WaltS Mar 8 '16 at 14:44
  • $\begingroup$ 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. $\endgroup$ – Stephen Grimes Mar 8 '16 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.