def makeDecision(self, positions):
    tick = self.models.Ticks.one()
    for p in positions:
        onePosition = p.positions[0]
        oneTick = tick[onePosition.exchanger]
        var = PositionsManager.calcVariation(oneTick, onePosition)
        if (onePosition.side == OnePosition.SideLong):
            if (var >= self.profitThres):
                return [(PlayerActions.CloseForProfit, p)]
            elif (var <= self.lossCutThres):
                return [(PlayerActions.CloseForLossCut, p)]
        elif (var <= (1.0 / self.profitThres)):
            return [(PlayerActions.CloseForProfit, p)]
        elif (var >= (1.0 / self.lossCutThres)):
            return [(PlayerActions.CloseForLossCut, p)]
    return []
def makeDecision(self, positions):
    tick = self.models.Ticks.one()
    for p in positions:
        onePosition = p.positions[0]
        oneTick = tick[onePosition.exchanger]
        var = PositionsManager.calcVariation(oneTick, onePosition)
        if (onePosition.side == OnePosition.SideLong):
            if (var >= self.profitThres):
                return [(PlayerActions.CloseForProfit, p)]
            elif (var <= self.lossCutThres):
                return [(PlayerActions.CloseForLossCut, p)]
        elif (var <= (1.0 / self.profitThres)):
            return [(PlayerActions.CloseForProfit, p)]
        elif (var >= (1.0 / self.lossCutThres)):
            return [(PlayerActions.CloseForLossCut, p)]
    return []