开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: Obtaining more than 1,000 ticks of historical data


Erez Kaplan
 

Hi,

I use a simple but robust trick, which will get as many ticks as you like.
start with one call and then at reqHistoricalDataEnd - change time and ask again.
(Snippit - not complete)

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

This is the trick: at end data you post another one, changing the times you want
def historicalDataEnd(self, reqId: int, start: str, end: str):


self.historicDate += datetime.timedelta(minutes=30)

xDay = self.historicDate.strftime("%Y%m%d %H:%M:%S")


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

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