Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Looping the Historical ticks request
Use?for acquiring live tick data ( as long as cancel- or API termination) - you may get a front run by parameter?numberOfTicks?for maximal 1000 historical ticks
I understand you wanting to procure more then 1000 historical ticks (by somehow looping the request) - sorry, that is not possible by that IBKR API: seems you need a 3rd party data provider. |
Nick
That is not correct.
toggle quoted message
Show quoted text
reqHistoricalTicks takes start and end times. You can specify the end time you want for the first request. Then subtract 1 from the oldest received timestamp and use that for the end time of the next request. This will allow you to loop backwards and collect as many ticks as you want. You can also use the start time and use the same approach to loop forward. On 5/30/2021 10:11 AM, Sebastian wrote:
I understand you wanting to procure more then 1000 historical ticks (by somehow looping the request) - sorry, that is not possible by that IBKR API: seems you need a 3rd party data provider. |
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 |
yes thank you! On Mon, May 31, 2021 at 9:28 AM <erezkaplan90@...> wrote: Hi, |
to navigate to use esc to dismiss