I think there is some serious bug associated with algorithms with monthly rebalance, or may be rebalance() in general, or maybe with algorithm that only rebalance once a year.
When you run the algorithm year by year, it would generate much smaller gain vs. if you run it over 10-15 years. There seems to be additional cash credited to the total balance every month for unknown reasons (and that cash is not dividend from stocks).
For example: in the algorithm listed here, if you run it from 2003 to 2015, the gain in year 2013 alone is about 75%, but if you run it just from 12/31/2012 to 12/31/2013, it is 57%. Similarly, the gain in year 2009 is 142% if you run in 12 years, but only 107% if you run it for that single year.
Also, when I run it from 2003-01-04 to 2009-12-31, it is 515% gain. When I run it from 2009-12-31 to 06-24-2015, it is 93% gain. So the total gain is (5.15 + 1) * (.93 + 1) - 1 = 1087%. But when you run from 2003-01-04 to 06-24-2015, the gain is 1398%.
Imagine if you trade live with this backtest result, it could be disastrous.
So I think this bug should be verified and should be fixed as soon as possible.