Пример #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)
Пример #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)
Пример #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)