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
- Twsapi
- Messages
Search
Re: Looping the Historical ticks request
yes thank you! On Mon, May 31, 2021 at 9:28 AM <erezkaplan90@...> wrote: Hi, |
Re: back and glad for it
You run 6 instances for different accounts or for one account? Probably 3 accounts with paper and live? On Mon, May 31, 2021, 10:25 AM Hartmut Bischoff <topofocus@...> wrote:
|
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 |
back and glad for it
Stuart Cracraft
Hi everybody,
I¡¯m back and also wanted to express my thanks to folks here for helping me to stand-up automated trading through IB. I couldn¡¯t be more delighted. My only nit is that having to run the TWS app on a full dedicated desktop instance and not having been able to stand up any reasonable thin Linux client is, honestly, my only disappointment. Cheers, Stuart |
TWS vs Gateway at reconnections
Last week I was running the TWS and the gateway simultaneously when my internet connection suddenly disappeared. While the gateway attempted to reconnected many times until finally the connection was reestablished exited the TWS directly
and made no attempts to reconnect. I'd prefer the TWS to behave like the gateway did (reconnect when the internet is available again). How can I change the behaviour of the TWS? |
Re: Looping the Historical ticks request
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. |
Re: 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. |
Re: OrderState Status Partial Fill
My vote is on since callbacks are messy and unreliable.
First of all you get many duplicates and there is a good chance that you don't get some that you really want. We have seen cases where orders change status while TWS had no connection with IB (during the maintenance window or during network issues) and none of the orderStatus messages that we would have expected were delivered after connection restauration But the execution reports and account updates did get delivered as soon as TWS reestablished connection. |
Re: OrderState Status Partial Fill
I don't think there is a status text specifically for partially filled orders. Such working orders will have the status "Submitted" and change to "Filled" once completely executed.
Every change in the status of the order is communicated with the OrderStatus callback. It conveys information about filled and remaining amounts amongst other things. Alternatively, you can count order executions with the ExecDetails callback. |
Re: Adding Attributes to Order Object
There is no way to add fields to the Order object that travel all the way to IB and back to you. That would be a scary thought from a security point of view.
But depending on what you are trying to achieve, here a couple thoughts:
JR |
Adding Attributes to Order Object
All,
I am wondering if there is any way to add an attribute to an Order object placed at IB, then return the order object from IB with that attribute.? Currently when I try this, the attribute I added to the order is simply not in the returned object I receive from IB.? My understanding of the IB EWrapper/Eclient system is that this is likely impossible, but I wanted to see if there was any similar way to store customized information in the order object that will be stored. Thanks, Mike |
Re: Getting Option Call Open Interest (tickId 27) and Option Call Volume (tickId 29)
Thanks a lot Nick, It worked for?Option Call Open Interest (tickId 27) but for some?reason it doesn't get any?Option Call Volume (tickId 29). Maybe I should calculate the volume requesting historical data of the day for the option contract. Regards. El vie, 28 de may. de 2021 a la(s) 09:41, Nick (news1000@...) escribi¨®: Tick types 27 and 29 come back in tickSize instead of tickString. |
Re: Getting Option Call Open Interest (tickId 27) and Option Call Volume (tickId 29)
Nick
Tick types 27 and 29 come back in tickSize instead of tickString.
toggle quoted message
Show quoted text
On 5/28/2021 10:20 AM, Pirro Trader wrote:
I'm trying to get?Option Call Open Interest (tickId 27) and Option Call Volume (tickId 29) with the following code, but I only get "TickerId: 99 TickType: 49 Value: 0.0" in?TickGeneric function?all the time, no matter the option contract I specify. |
Getting Option Call Open Interest (tickId 27) and Option Call Volume (tickId 29)
Hello, I'm trying to get?Option Call Open Interest (tickId 27) and Option Call Volume (tickId 29) with the following code, but I only get "TickerId: 99 TickType: 49 Value: 0.0" in?TickGeneric function?all the time, no matter the option contract I specify. ? ? contract = Contract() ? ? contract.symbol = "DIS" ? ? contract.secType = "OPT" ? ? contract.exchange = "CBOE" ? ? contract.currency = "USD" ? ? contract.lastTradeDateOrContractMonth = "20210604" ? ? contract.strike = 152.5 ? ? contract.right = "C" ? ? contract.multiplier = "100" ? ? print('*** Invoking reqMktData') ? ? #client.reqMarketDataType(29) ? ? client.reqMktData(99, contract, "100,101", False, False, []) Any idea of what I'm doing wrong? Regards Best regards |
to navigate to use esc to dismiss