November 2019
Beginner
394 pages
10h 31m
English
Market Data request handling allows the acceptor (the exchange) to register the request from an initiator who's willing to trade a given symbol. Once this request is received, the acceptor starts streaming the price updates to the initiator. Let's have a look at the following code:
def onMarketDataRequest(self, message, sessionID): requestID = quickfix.MDReqID() try: message.getField(requestID) except Exception as e: raise quickfix.IncorrectTagValue(requestID) try: relatedSym = self.fixVersion.MarketDataRequest.NoRelatedSym() symbolFix = quickfix.Symbol() product = quickfix.Product() message.getGroup(1, relatedSym) relatedSym.getField(symbolFix) relatedSym.getField(product) if product.getValue() != quickfix.Product_CURRENCY: ...