def handle_data(self, data):
        if self.incr == 0:
            assert 0 not in self.portfolio.positions
        else:
            assert self.portfolio.positions[0]['amount'] == \
                self.incr, "Orders not filled immediately."
            assert self.portfolio.positions[0]['last_sale_price'] == \
                self.last_price, "Orders was not filled at last price."
        self.incr += 1
        self.order_value(self.sid(0), data.current(sid(0), "price"))
        self.last_price = data.current(sid(0), "price")
dataset/ETHPy150Open quantopian/zipline/zipline/test_algorithms.py/TestOrderInstantAlgorithm.handle_data/original