Ejemplo n.º 1
0
    def executeOrder(self, event):

        trade = events.TradeEvent(self.date, event.symbol, 'NYSE',
                                  event.quantity, event.price,
                                  event.quantity * event.price)

        self.event.append(trade)
Ejemplo n.º 2
0
    def execute(self, index):

        order = self.event.popleft()

        trade = events.TradeEvent(
            datetime.datetime.now(), order.symbol, 'NYSE', order.quantity,
            self.handler.get_latest_bar(order.symbol)[1][5], ' ',
            order.quantity * self.handler.get_latest_bar(order.symbol)[1][5])
        self.portfolio.fill(trade, index)
Ejemplo n.º 3
0
    def execute(self):

        order = self.event.popleft()

        trade = events.TradeEvent(
            self.handler.get_latest_bar_datetime(self.symbol), order.symbol,
            'SGX', order.quantity,
            self.handler.get_latest_bar_value(order.symbol, ''), ' ',
            order.quantity *
            self.handler.get_latest_bar_value(order.symbol, ''))
        self.portfolio.fill(trade)