Revert "STY: Removed drop_condition arguments."

This reverts commit c7383f6275.
This commit is contained in:
Thomas Wiecki
2012-12-11 12:12:32 -05:00
parent 3aaa2ef5a2
commit 8621eb2223
+9 -5
View File
@@ -241,7 +241,12 @@ class EventWindow(object):
# Clear out any expired events. drop_condition changes depending
# on whether or not we are running in market_aware mode.
while self.drop_condition():
#
# oldest newest
# | |
# V V
while self.drop_condition(self.ticks[0].dt, self.ticks[-1].dt):
# popleft removes and returns the oldest tick in self.ticks
popped = self.ticks.popleft()
@@ -249,7 +254,7 @@ class EventWindow(object):
# behavior for removing ticks.
self.handle_remove(popped)
def out_of_market_window(self):
def out_of_market_window(self, oldest, newest):
# Find number of unique days in window
# Note that this assumes that each day we received an
# event is a trading day.
@@ -257,9 +262,8 @@ class EventWindow(object):
return len(unique_dts) > self.window_length
def out_of_delta(self):
# newest - oldest
return (self.ticks[-1].dt - self.ticks[0].dt) >= self.delta
def out_of_delta(self, oldest, newest):
return (newest - oldest) >= self.delta
# All event windows expect to receive events with datetime fields
# that arrive in sorted order.