quantopian/zipline — pull request #163 by twiecki (2013-05-16 13:03:20+00:00)
Title: BUG: Fix updating of trading_days_total in minute.

In the batch_transform we were incrementing the trading_days counter if there
is a new day event. Thus with a window_length of 1 and daily bars you will
update the batch_transform on the first day which is correct. But with minutes
you update with the first minute bar of the day which is not correct.

This is fixed by calculating the market_close explicity and seeing whether the
event.dt is on or past it.

I also added a unittest to test the correct behavior of this.