Keyboard Shortcuts
Likes
- Twsapi
- Messages
Search
Re: limit orders can have status "Submitted" but not show up in Level2 or NBBO ?
maybe it is submitted to IB's "marketplace" and the counterparty could be IB? Check this: El mar, 7 nov 2023 a las 17:36, <youngneal@...> escribi¨®:
|
||
Re: conflicting orderStatus messages
Let's clarify a point: I will be really astonished that IB send ::execDetails before ::openOrder
However callbacks are asynchronous. So what I wrote above is "generally" the sequence to expect. I guess that IB does try to respect a certain sequence and their messaging system are a queue, so they can control this. However their doc doesn't explicitly says that they are committed to respect a specific sequence. Always be ready for an execution out of sequence and you can only safely rely on receiving one openOrder call back, but not more. (read para on orderStatus) and in due time ::execDetails. |
||
Re: conflicting orderStatus messages
From my perspective what you describe look strange. |
||
Re: conflicting orderStatus messages
Here is what I got in terms of corresponding errors:
97536,201,Order rejected - reason:Order is already filled,,1699367542.897107,2023-11-07 09:32:22.897107 97536,104,Cannot modify a filled order.,,1699367542.930087,2023-11-07 09:32:22.930087 The order was a simple order, no groups, nothing else. Yes, in my experience execDetails always comes first, and contains the most fields I need, openOrder and orderStatus usually come some 200ms or so later, often in doubles, and sometimes contradictory, like this one. |
||
Re: How to link 2 orders on 2 different contracts so that the 2nd one is executed only if the 1st one gets filled and have this sit on the IB side?
¿ªÔÆÌåÓýAce, I totally get it. Early exercise is a problem with SPY. Switch to SPX and you won't have that risk.
rgds, Bart On Nov 6, 2023 at 7:25?PM -0800, Ace via groups.io <fbaribeau1967@...>, wrote: Bart, |
||
Re: conflicting orderStatus messages
You give us very little to work with. For example, was this order in an OCA group with other orders, or did it have an Order Condition that could have caused a cancellation, ... Gordon pointed you to the right places for some background. The first sentence of "Considerations for Automated Systems" is probably one of the most important considerations where its says "... it is important to monitor for callback notifications, specifically for When we get a "Cancelled" order status (for example from a "self destruct" price condition on limit orders, an OCA group, or order cancellation request) we always get an error 202 callback (more an informational message than an error). errorMsg in that callback usually contains the reason for the cancellation. Any chance you have logged that, too? ´³¨¹°ù²µ±ð²Ô On Tue, Nov 7, 2023 at 08:41 AM, bespalex wrote:
Has anyone experienced this? |
||
Re: conflicting orderStatus messages
on the Cancelled: filled and remaining are 0 , so I won't be bothered, everything reported is consistent. I can speculate at 09:32 that there are a lot of action on QQQ, |
||
Re: limit orders can have status "Submitted" but not show up in Level2 or NBBO ?
Thank you for the response, Gordon.
?
I can't identify the order, but I know it's not any of the orders visible in level 2, just because none of those orders have the right price (or even close, sometimes). ?Likewise for NBBO. ? In fact, in the cases I care most about, the price I am submitting is strictly between the best bid and ask showing in NBBO or level2 (and the best bid and ask do not change even after TWS says my order is submitted). ?
?
It is either normal size (e.g. 100, or?larger, but with a display size of 100).
?
I route it through SMART often. ?Other times NYSE or ARCA specifically. ?Often when I see the delay I'll (manually!) cancel the order and place it again with a different exchange. ?Sometimes that helps, sometimes it doesn't. ?That it often doesn't help suggests to me that something is backlogged at TWS.
?
Indeed, what it _looks like_ to me is that when TWS is saying it is submitted, it's not actually submitted (and accepted) yet at the exchange. ?But I'm not sure of that, of course.
?
-Neal |
||
limit orders can have status "Submitted" but not show up in Level2 or NBBO ?
|
||
Re: orderRef visibility
Look at tag 6010. |
||
conflicting orderStatus messages
Has anyone experienced this?
2023-11-07 09:32:22,778 [INFO? ? ] __main__: Order Executed: -1 QQQ STK USD 00025b49.6549ea2c.01.01 97536 100 2 2023-11-07 09:32:22,791 [INFO? ? ] __main__: orderStatus - orderid: 97536 status: Filled filled: 100 remaining: 0 lastFillPrice: 370.13 permId: 900345789 parentId: 0 clientId: 123 2023-11-07 09:32:22,923 [INFO? ? ] __main__: orderStatus - orderid: 97536 status: Cancelled filled: 0 remaining: 0 lastFillPrice: 370.13 permId: 900345789 parentId: 0 clientId: 123 The order was actually executed, so why the 'Cancelled' status confirmation? |
||
Re: How to link 2 orders on 2 different contracts so that the 2nd one is executed only if the 1st one gets filled and have this sit on the IB side?
I don't know of any definitive documentation, but my best guess is that the Execution Condition gets triggered as soon as IBKR needs to send an object via for the monitored symbol. Each partial fill for an order generates a separate object so that it is likely the condition triggers upon the first and possibly partial fill. ´³¨¹°ù²µ±ð²Ô On Mon, Nov 6, 2023 at 06:01 PM, Ace wrote:
Do you think it checks for any execution or a full order filled? |
||
Re: Question regarding reboot of trader workstation
That is correct. There is a TWS API Global Setting that can eliminate the race condition for a large class of orders. It is called "Use negative numbers to bind automatic orders". When selected, automatic orders get bound to monotonously decreasing negative numbers and, therefore, will not interfere with the client's requirement of using monotonously increasing orderIds for new orders. The remaining cases need to be eliminated by design. When several independent clients place orders in the same account, there is probably a need for coordination amongst them anyway (account margin management, avoiding opposing orders for the same instrument, ...)? so that one shared orderId assignment strategy could be used. And the measure of last resort is monitoring the "Duplicate OrderID" error 103. The client could assign a new (higher) orderId and retry the placeOrder request. ´³¨¹°ù²µ±ð²Ô On Mon, Nov 6, 2023 at 10:38 PM, Little Trader wrote:
|
||
Re: Question regarding reboot of trader workstation
Thanks for the very informative posts.I was looking into orderId recently and it solved my problem.One little comment about the following cited piece in the document.
I think it is inherently a race condition. Think about the situation that an orderStatus callback is en route from TWS to the master client while at the same time the master client is placing an order. In this event, there may be order id collision. |