Adds extra constraint of year to check for day inequality.

The .day member of datetime only gives the number of the day of the
year, which is insufficient when checking for < than.

However in this use, we may just want to check for an 'not equals'
This commit is contained in:
Eddie Hebert
2012-10-09 12:59:54 -04:00
parent 0f819474e0
commit 98f063464e
+3 -1
View File
@@ -83,7 +83,9 @@ class VolumeShareSlippage(object):
if(order.dt < event.dt):
# orders are only good on the day they are issued
if order.dt.day < event.dt.day:
if (order.dt.year, order.dt.day) < \
(event.dt.year, event.dt.day):
continue
open_amount = order.amount - order.filled