def tickByTickAllLast(self, reqId, tickType, time, price, size, attribs, exchange, specialConditions): ticker = self.reqId2Ticker.get(reqId) if not ticker: self._logger.error(f'tickByTickAllLast: Unknown reqId: {reqId}') return attribs = TickAttrib(**attribs.__dict__) tick = TickByTickAllLast(tickType, self.lastTime, price, size, attribs, exchange, specialConditions) ticker.tickByTicks.append(tick) self.pendingTickers.add(ticker)
def tickByTickAllLast(self, reqId, tickType, time, price, size, tickAttribLast, exchange, specialConditions): ticker = self.reqId2Ticker.get(reqId) if not ticker: self._logger.error(f'tickByTickAllLast: Unknown reqId: {reqId}') return if price != ticker.last: ticker.prevLast = ticker.last ticker.last = price if size != ticker.lastSize: ticker.prevLastSize = ticker.lastSize ticker.lastSize = size tick = TickByTickAllLast(tickType, self.lastTime, price, size, tickAttribLast, exchange, specialConditions) ticker.tickByTicks.append(tick) self.pendingTickers.add(ticker)