Login Page - Create Account

Support Board


Date/Time: Fri, 29 Mar 2024 14:42:29 +0000



[Locked] - Trade filled by IB even though it was cancelled

View Count: 4845

[2013-12-19 05:56:46]
deepgreen - Posts: 6
I placed an order to sell 100 shares of SPY at around 9:20 PST in Sierra Charts. I cancelled this order just seconds later. This was an OCO order where a buy stop was placed a few ticks above the sell order - I cancelled the main order and the corresponding sub orders were cancelled as well by Sierra. The logs of Sierra charts showed these as cancelled and the screen did not show these as active. But at 11:02 PST the sell order was filled and the stop orders were not filled.
The log from Sierra charts is below and attached. Please reply soonest.

Date Time Of Last Edit: 2014-01-02 08:15:44
[2013-12-19 08:34:58]
Sierra Chart Engineering - Posts: 104368
This is where you canceled the order and the order cancellation was sent to Interactive Brokers using the Order ID of 30:

Order 2013-12-18 09:20:18.000 SPY SPY 4 renko #3 ; User order cancel 65 30 Limit 100 Sell 178.69 Pending Cancel ******* Open

Notice how it has a status of Pending Cancel.

The 2 child orders were never sent to Interactive Brokers, so they were internally canceled within Sierra Chart.


This line shows that Interactive Brokers never acknowledged the order cancellation . When the order list was refreshed either automatically or manually by you, Interactive Brokers did not indicate the order was Open and it was set to a canceled state because it was not indicated as an open order ( it did not exist according to the order list from IB):
Order 2013-12-18 09:21:20.000 SPY Canceling due to no order update 65 30 Limit 100 Sell 178.69 Canceled Cancel ******* Open

You better contact Interactive Brokers about this.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2014-01-07 00:47:24
[2013-12-19 15:58:15]
deepgreen - Posts: 6
OK but you miss the point - Sierra assumed the order was cancelled based on the poor and dangerous assumption that a no reply is acctually a cancellation - you say in the log Canceling due to no order update . Wrong - no reply obviously means it more likely that IB didn't get the cancellation request. How could it be assumed that a no-reply means it was cancelled. At the very least a warning message should be brought up that the order cancellation did not go through.

Please explain.
[2013-12-19 16:03:48]
deepgreen - Posts: 6
And yes I am taking this up with IB.
[2013-12-19 17:59:55]
Sierra Chart Engineering - Posts: 104368
There was a reply from Interactive Brokers. When the open orders are requested from TWS, they send an end message indicating when all the open orders have been sent. If an order is marked as open in Sierra Chart but it was not in the open order list from TWS, then when the open orders end message is received, at that time the orders that did not received an update are marked as canceled if they are open.

If we did not do this, then sometimes this results in orders displayed on a chart or Trade DOM that are actually not open/working anymore. This is yet another problem from Interactive Brokers. Periodically we would hear about this kind of problem in the past and we still do because the orders will still show on the chart for a certain period of time.

There are just too many problems with their system. And Interactive Brokers did get the cancellation request. The possibility that they did not, is next to 0%. The log makes it very clear they must have gotten it.

We take no responsibility here. It is quite clear that the Interactive Brokers order API is not well designed, this is very clear to us from an engineering perspective, and is not stable.

This just yet another example, of the problems when using the Interactive Brokers system. The whole thing is very unfortunate for users and takes too much of our time dealing with these problems which we have no control over.

In the case of futures trading, we would not recommend Interactive Brokers to anyone. In the case of stock trading, at the time this is the only option we have available for stock trading with low commissions. We should look at another option.


Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2013-12-19 18:05:45
[2013-12-19 18:50:13]
Sierra Chart Engineering - Posts: 104368
This is an example of the log messages you will see in the TWS log file when canceling an order:


DD 07:41:48:159 JTS-EServerSocket-123: [0:62:68:1:0:0:0:INFO] Handling incoming CancelOrder message.
DD 07:41:48:160 JTS-EServerSocket-123: [0:62:68:1:0:0:0:INFO] Cancelling orderId {107}.
DD 07:41:48:160 JTS-EServerSocket-123: CANCELSOURCE SEL
DD 07:41:48:160 JTS-EServerSocket-123: [0:62:68:1:0:0:0:INFO] OrderId {107} is cancelled.

This is when the API logging level is set to "Info".

We have also performed a code review, and see no problems at our side. Once the status of the order went to Pending Cancel, at that time the order cancellation was sent to TWS and there is no room for any kind of failure at that point in time. If you were not connected to TWS, you would not even be able to cancel the order to begin with.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2013-12-19 19:33:15]
deepgreen - Posts: 6
Thanks for this. Yes, I can see that it can happen like this - if their API is not constructed in a robust way. But I strongly recommend that Sierra bring up a warning that the cancellation was not properly received in the log - ie. it timed out and the state of cancellation is unknown. i.e. on seeing this message in the log users could check it out in IB. I do take your point on ensuring that IB need to fix the primary fault but I do not like Sierra not putting this inconsistency in a log. After all the message in their sounds as if it was cancelled -

The best way is for Sierra to requery the order status in the IB API. ie. Meaning that you have the API and you should requery if the cancellation actually went through. My problem is that you just assume its OK - you did not leave a proper message and you did not use the API.




[2013-12-19 20:46:14]
deepgreen - Posts: 6
OK I have contacted engineering at IB and I had a brief upate on their API. Its as I said above your software is not using the API correctly. Anyway please provide me your support email so I can pass on the contact in IB as they want to reply directly to you. Best this is taken up at the engineering level.
.
[2013-12-19 21:04:17]
Sierra Chart Engineering - Posts: 104368
Hard to believe we are not using their API correctly.

They can use support AT Sierra Chart.com. It's doubtful we are going to learn anything new or find a resolution to the problem.


The best way is for Sierra to requery the order status in the IB API. ie. Meaning that you have the API and you should requery if the cancellation actually went through. My problem is that you just assume its OK - you did not leave a proper message and you did not use the API.

It is not possible to get the status of an order that is no longer open in TWS. When Sierra Chart did query the open orders a minute later, either because you manually refreshed the orders or Sierra Chart did a periodic open order request, the order was not reported by TWS as existing. When you say that we assumed the order was actually canceled, that is not correct. We got a definitive indication of the order was not open any longer. The API was used. The log indicates that very clearly.

We see no reasonable changes that can be done at this point.

And quite honestly, we have little interest in spending any further time on this problem . Clearly we are doing everything properly and we see no reasonable changes that can be done. Also we are very busy at this time with end of year development and we do not have time to spend on this now.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2013-12-19 21:18:36
[2013-12-19 23:23:02]
Sierra Chart Engineering - Posts: 104368
Something we just realized. After this line, there is no line indicating the order status went to Open:

Order 2013-12-18 09:20:11.002 SPY SPY 4 renko #3 ; User order entry 65 Limit 100 Sell 178.69 Order Sent ******** Open

It was stuck in an Order Sent state which makes sense as to why when you tried to cancel it, there was no response from TWS.

The focus of the issue, is why was there not a response from the API indicating the status of the order whether it was accepted or rejected. Please work with Interactive Brokers on this first. This must be the focus right now. After that question is answered and the solution is implemented, then your other concerns can be considered.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2014-01-07 00:49:05
[2013-12-20 06:12:59]
deepgreen - Posts: 6
I attach the audit trail from IB showing that the API did respond with an acknowledgement.Meaning the issue is closed with them.
And I went over this with IB and they refer to their order trail that shows the order was placed and acknowledged.
According to the API team in a situation like this then you could query the status of the order with one of their call backs in which case it would show as active as a result of this call.

But IB are willing to review this with you - in the interest of building a reliable solution. Angel a programmer is willing to discuss this with you.

Bottom line I do not see any fault with IB - its all up to how Sierra deals with the situation of an order sent when somehow the Acknowledgement was lost. In your case you wait a period of time and then deem it cancelled. maybe its better you use their APIs to check if the order actually exists or put up a warning message for the user to check in the broker system.




Date Time Of Last Edit: 2013-12-20 07:14:52
Private File
[2013-12-20 06:54:01]
Sierra Chart Engineering - Posts: 104368
Same story.

Interactive Brokers claims the problem is not with them. The log they have provided you, is not the actual TWS socket stream . That is what is necessary to conclusively indicate what data was actually received. However, no such log actually exists to our knowledge. The log they have given you, looks like a FIX data type of log. It also contains repeating entries.

Another thing about the log is that identifies the client order ID as ************. The client order ID we assigned it is 30. So there is no direct relationship between the 2 IDs, indicating that this logging is not programmatically close to or monitoring the the TWS socket stream. It exists at some other level within TWS or the IB backend system. It may be coming off their backend server. This is what we suspect. Which means it is very far removed from the actual problem.



In your case you wait a period of time and then deem it cancelled.
This is 100% inaccurate. We do no such thing.

We are willing to see what Angel has to say. Have them contact us at our email address. Although I don't see where this is going to go. If they are interested in a reliable solution I will refer them to DTC protocol:
http://www.sierrachart.com/index.php?l=doc/doc_GeneralDataTradeServiceProtocol.php

Although it is doubtful that Interactive Brokers management would be interested in adopting it.

This matter is not even really up to us to resolve. They need to monitor their socket stream to identify these kinds of issues And then resolve them. How does this involve us? It does not. Therefore, the whole conversation seems rather pointless unless they can produce clear evidence of a problem on our side or if the problem is on their side, acknowledge it and resolve it. In the last case, this does not involve us.

According to the API team in a situation like this then you could query the status of the order with one of their call backs in which case it would show as active as a result of this call.
The Sierra Chart Trade Activity Log you provided, does confirm that we did exactly this and the Interactive Brokers TWS API, indicated the order did not exist. We did further testing today to confirm that this indeed works as expected.


Now, after having said all of this, we are running a full technical review of all of this. One thing we are no longer going to do is request the open orders from TWS every four minutes. Which means, people are going to notice more stuck orders that stay on their charts.

If someone wants to refresh the orders, they will have to manually do that through Trade >> Refresh Trade Data from service. Although there will be a periodic request every four hours.

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2014-01-07 00:12:01
[2013-12-20 07:56:17]
Sierra Chart Engineering - Posts: 104368
Basically what we are dealing with is the following:

-You know that Interactive Brokers is a large organization that is not easily influenced are controlled by one little customer. So you look to us for solutions to their flaws which you know, are very hard to get resolved. We give you what you want. If there are problems, that are within our control, we will promptly take care of them.

-You may believe that there are certain things Sierra Chart is doing in its interface the TWS which is contributing to the problem. We have explained this is not the case, to the best of our ability.

-Interactive Brokers is producing backend server evidence showing that the order was accepted and acknowledged. Of course they can produce that because the order was submitted, properly from Sierra Chart. What they cannot produce, is the actual low-level socket stream from TWS to Sierra Chart showing the subsequent order status updates. This is where the problem lies.

-While we all would like, the problem to be solved, the basic fact is we are helpless to definitively resolve this problem unless we develop our own connectivity to exchanges and push Interactive Brokers aside. Perhaps we will get to that point one day.

-It is far more productive, to find an alternative solution. So we will keep this in mind during the coming year to see what alternatives exist. There is going to be something viable out there.








Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-11 22:15:19
[2018-02-11 08:56:28]
User164231 - Posts: 278
It seems TWS favor their internal orders when volume is high. I keep having strange problems such as modifying orders not accepted, delayed or lmt order hit but it became cancelled either at SC or TWS end.

Frustration to say the least and could be costly when scalping intraday.

I am going to reduce SC CPU usuage and see if the situation gets better.

If you can introduce me a good Hang Seng futures broker with good LVL 2 data I would like to try them out.
[2018-02-11 22:16:53]
Sierra Chart Engineering - Posts: 104368
Looking back at this thread, this is just yet another God damn waste of time and trash from Interactive brokers!!!!.


Don't waste our our time IB problems. Take their trash to them.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2018-02-11 22:47:02]
Sierra Chart Engineering - Posts: 104368
Bottom line I do not see any fault with IB -
Both you and Interactive Brokers can go to hell. How dare you say that with all of the garbage and problems with them over the years and all the suffering they have inflicted upon users and us. Go to hell!! We are not here to be nice about this whatsoever and you can post this all over the Internet.

This will serve as a warning to all of our Interactive Brokers. Do not bring any of the Interactive Brokers problems to us. We have had enough of their garbage.

And to top it off we are telling the Chicago Mercantile exchange to go to hell as well. How dare you bastards, charge for market data when there was all this effort on the part of clearing firms, brokers, trading technology providers, and software developers like us, supporting your trading activity. And then you try to extract fees from publicly provided data from the traders themselves.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-08-22 05:49:25
[2018-02-11 23:24:05]
Sierra Chart Engineering - Posts: 104368
In response to post #15, our comments in post #16 and #17, are not in response to you at all. Once again they are not in response to you at all.



These are just general complaints about Interactive Brokers and the exchanges.

Here are our answers for your questions:

I am going to reduce SC CPU usuage and see if the situation gets better.
This is not going to help at all.

If you can introduce me a good Hang Seng futures broker with good LVL 2 data I would like to try them out.
For this particular exchange, the only other choice would be a CQG broker. Refer to:
CQG Trading Platform Service

Also you can use the Sierra Chart Exchange Data Feed for good reliable Hong Kong futures data:
Sierra Chart Exchange Data Feed
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-11 23:25:06
[2018-02-11 23:50:13]
Sierra Chart Engineering - Posts: 104368
Also when we heard from Interactive Brokers about this particular issue that the first post is about, they did acknowledge, that there may not always be an order status message indicating that the order has been filled and it is necessary in the execution report to look at the order quantity and the total filled quantity and if those match, then to determine that the order has fully filled. This basically is an undocumented hack.

And what is even more absurd about this, is that why are they asking us to do this? This should be done on with us Interactive Brokers side. When an order fills, they need to provide a filled order status. They do not always do that. This is total gross mismanagement and incompetence on the part of Interactive Brokers.

Also refer to:
Interactive Brokers Trading Service: Trading Related Issues
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-02-12 18:35:00

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account