def handle_data(self, data):
        if len(self.portfolio.positions) > 0:
            if 0 > self.portfolio.positions[self.asset.sid]["amount"]:
                self.order_target(self.asset, -self.amount)
            else:
                self.order_target(self.asset, 0)
        else:
            self.order_target(self.asset, self.amount)

############################
# AccountControl Test Algos#
############################
dataset/ETHPy150Open quantopian/zipline/zipline/test_algorithms.py/FutureFlipAlgo.handle_data/swapped operands of `>`