I wonder if I would have come to such a simple an elegant solution so quickly. The only contribution I could think of is to use the simplification in the comparison that Python offers class MyStrategy(...): def next(self): timenow = self.data0.datetime.time(0) if datetime.time(11, 31) <= timenow <= datetime.time(12, 59): ... your logic here ... Storing the time instances would be wise to avoid creation and recreation of the instances.