mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-01 16:52:26 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user