¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: Looping the Historical ticks request


 

Hi,

It's done so:
start with one call

? ? ?self.reqHistoricalData(self.hisID, self.contract, self.lastxDay, "1800 S", "1 secs", BID_TYPE, 0, 1, False, [])

? ? ?def historicalData(self, reqId, bar):
? ? ? ? ?# do your stuff

Here come the magic
###################
? ? def historicalDataEnd(self, reqId: int, start: str, end: str):
? ? # once the data ends, you issue a new request, after altering the time?
? ? ?self.historicDate += datetime.timedelta(minutes=30)
? ? ?self.reqHistoricalData(self.hisID, self.contract, self.historicDate?, "1800 S", "1 secs", BID_TYPE, 0, 1, False, [])

Hope this helps

Join [email protected] to automatically receive all group messages.