Пример #1
0
 def reqHistoricalTicksAsync(self, contract, startDateTime, endDateTime,
         numberOfTicks, whatToShow, useRth,
         ignoreSize=None, miscOptions=None):
     reqId = self.client.getReqId()
     future = self.wrapper.startReq(reqId)
     start = util.formatIBDatetime(startDateTime)
     end = util.formatIBDatetime(endDateTime)
     self.client.reqHistoricalTicks(reqId, contract, start, end,
             numberOfTicks, whatToShow, useRth,
             ignoreSize, miscOptions)
     return future
Пример #2
0
 def reqHistoricalDataAsync(self,
                            contract,
                            endDateTime,
                            durationStr,
                            barSizeSetting,
                            whatToShow,
                            useRTH,
                            formatDate=1,
                            keepUpToDate=False,
                            chartOptions=None):
     reqId = self.client.getReqId()
     bars = BarDataList()
     bars.contract = contract
     bars.endDateTime = endDateTime
     bars.durationStr = durationStr
     bars.barSizeSetting = barSizeSetting
     bars.whatToShow = whatToShow
     bars.useRTH = useRTH
     bars.formatDate = formatDate
     bars.keepUpToDate = keepUpToDate
     bars.chartOptions = chartOptions
     future = self.wrapper.startReq(reqId, bars)
     if keepUpToDate:
         self.wrapper.startLiveBars(reqId, bars)
     end = util.formatIBDatetime(endDateTime)
     self.client.reqHistoricalData(reqId, contract, end, durationStr,
                                   barSizeSetting, whatToShow, useRTH,
                                   formatDate, keepUpToDate, chartOptions)
     return future
Пример #3
0
 def reqHistoricalDataAsync(self,
                            contract,
                            endDateTime,
                            durationStr,
                            barSizeSetting,
                            whatToShow,
                            useRTH,
                            formatDate=1,
                            keepUpToDate=False,
                            chartOptions=None):
     reqId = self.client.getReqId()
     future = self.wrapper.startReq(reqId)
     if keepUpToDate:
         self.wrapper.startLiveBars(reqId, historical=True)
     end = util.formatIBDatetime(endDateTime)
     self.client.reqHistoricalData(reqId, contract, end, durationStr,
                                   barSizeSetting, whatToShow, useRTH,
                                   formatDate, keepUpToDate, chartOptions)
     return future