Exemplo n.º 1
0
 def historicalDataUpdate(self, reqId: int, bar: BarData):
     bars = self.reqId2Subscriber.get(reqId)
     if not bars:
         return
     bar.date = parseIBDatetime(bar.date)  # type: ignore
     hasNewBar = len(bars) == 0 or bar.date > bars[-1].date
     if hasNewBar:
         bars.append(bar)
     elif bars[-1] != bar:
         bars[-1] = bar
     else:
         return
     self.ib.barUpdateEvent.emit(bars, hasNewBar)
     bars.updateEvent.emit(bars, hasNewBar)
Exemplo n.º 2
0
 def historicalDataUpdate(self, reqId, bar):
     bar = BarData(**bar.__dict__)
     bars = self.reqId2Subscriber.get(reqId)
     if not bars:
         return
     bar.date = util.parseIBDatetime(bar.date)
     hasNewBar = len(bars) == 0 or bar.date > bars[-1].date
     if hasNewBar:
         bars.append(bar)
     elif bars[-1] != bar:
         bars[-1] = bar
     else:
         return
     self._ib.barUpdateEvent.emit(bars, hasNewBar)
     bars.updateEvent.emit(bars, hasNewBar)
Exemplo n.º 3
0
 def historicalData(self, reqId, bar):
     bar = BarData(**bar.__dict__)
     bar.date = util.parseIBDatetime(bar.date)
     self._results[reqId].append(bar)
Exemplo n.º 4
0
 def historicalData(self, reqId: int, bar: BarData):
     bar.date = parseIBDatetime(bar.date)  # type: ignore
     self._results[reqId].append(bar)
Exemplo n.º 5
0
 def historicalData(self, reqId: int, bar: BarData):
     results = self._results.get(reqId)
     if results is not None:
         bar.date = parseIBDatetime(bar.date)  # type: ignore
         results.append(bar)