def createAction(self):
    positions = self.getOpenPositions()
    positions = filter((lambda p: p.isOpen()), positions)
    closes = self.makeDecision(positions)
    self.logger.debug('Completed decision, #close={n}.'.format(n=len(closes)))
    if (len(closes) > 0):
        (actionType, position) = closes[0]
        return Action(actionType, position)
    else:
        return None
def createAction(self):
    positions = self.getOpenPositions()
    positions = filter((lambda p: p.isOpen()), positions)
    closes = self.makeDecision(positions)
    self.logger.debug('Completed decision, #close={n}.'.format(n=len(closes)))
    if (len(closes) > 0):
        (actionType, position) = closes[0]
        return Action(actionType, position)
    else:
        return None