Esempio n. 1
0
 def realtimeBar(self, reqId, time, open_, high, low, close, volume, wap,
                 count):
     dt = datetime.datetime.fromtimestamp(time, datetime.timezone.utc)
     bar = RealTimeBar(dt, -1, open_, high, low, close, volume, wap, count)
     bars = self.reqId2Bars[reqId]
     bars.append(bar)
     self.handleEvent('barUpdateEvent', bars, True)
     bars.updateEvent(bars, True)
Esempio n. 2
0
 def realtimeBar(self, reqId, time, open_, high, low, close, volume, wap,
                 count):
     dt = datetime.datetime.fromtimestamp(time, datetime.timezone.utc)
     bar = RealTimeBar(dt, -1, open_, high, low, close, volume, wap, count)
     bars = self.reqId2Subscriber.get(reqId)
     if bars is not None:
         bars.append(bar)
         self._ib.barUpdateEvent.emit(bars, True)
         bars.updateEvent.emit(bars, True)
Esempio n. 3
0
 def realtimeBar(
         self, reqId: int, time: int, open_: float, high: float, low: float,
         close: float, volume: int, wap: float, count: int):
     dt = datetime.fromtimestamp(time)
     bar = RealTimeBar(dt, -1, open_, high, low, close, volume, wap, count)
     bars = self.reqId2Subscriber.get(reqId)
     if bars is not None:
         bars.append(bar)
         self.ib.barUpdateEvent.emit(bars, True)
         bars.updateEvent.emit(bars, True)