I think this is a result of using daily data and being short an ETF when the dividend comes out.
E.g. your algo shorts SPY on 2012-06-13 (which it only gets on 2012-06-14 due to daily data). SPY had a dividend on 2012-06-15 (ex div date), which you have to pay, and that money comes out about 6 weeks later on 2012-07-31. I see the algo tries to close that short position on 2012-06-14, but I think with daily data that gets counted as being on the Register for that day (hmm, confusing)
IVV also has dividends, so that may be interacting with the cash flow too.
I think if you switch to minute mode and use
schedule_function
you'll get close to what you want (you'll still have to pay dividends though)