Snippets

Kim Minh Kaplan with Condition

Created by Kim Minh Kaplan last modified
def execDetails(self, reqId, contract, execution):
    if reqId == -1:  # FILL
        orderId = execution.orderId
        execId = execution.execId
    with self.fills_cond:
        known = orderId in self.fills
        if known:  
            self.fills_cond.notify_all()            
        else:     
            self.fills.setdefault(orderId, {})
            self.fills[orderId][execId] = (contract, execution)
    if known:  
        logging.info("Received execDetaills with reqId = %s (             not a FILL). To address", str(reqId))
    else:
        self.event_q.send(message.FillIBEvent(orderId, contract, execution))
    self._default_cb(reqId, contract, execution)

Comments (1)

  1. Kim Minh Kaplan

    The original code was wrong due to indentation garbage due being pasted in Hangout.

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.