Login Page - Create Account

Support Board


Date/Time: Sun, 12 May 2024 23:32:18 +0000



SC via Interactive Brokers not correctly setting OCO orders - important!

View Count: 5617

[2015-04-09 15:13:51]
corbeste - Posts: 74
Hi,

I use IB as a broker. Trading SPY, I usually enter at market with my standard 3-scale OCO order - all using the same stop but with staggered scales.
Quite often I notice that one of the OCO orders does not have the correct quantity.

To give an example:
Buy market SPY 207.0, 1000 shares.
There are 3 OCO orders, with the stop at 206.5.
Each OCO orders should be 333/334 shares.
One of these orders is set to 100 shares instead of 333.

This means if I am not paying attention, my position is not stopped out or scaled completely. Its very dangerous if I am not at the computer when the order is triggered.

It occurred today and I captured this from the service log:

Trading Message from IB: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.. Error Code: 2109. ServiceOrderID: 3147. | 2015-04-09 16:38:45
Trading Message from IB: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.. Error Code: 2109. ServiceOrderID: 3149. | 2015-04-09 16:38:45
Trading Message from IB: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.. Error Code: 2109. ServiceOrderID: 3150. | 2015-04-09 16:38:45
Trading Message from IB: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.. Error Code: 2109. ServiceOrderID: 3152. | 2015-04-09 16:38:45
Trading Message from IB: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.. Error Code: 2109. ServiceOrderID: 3153. | 2015-04-09 16:38:45
Trading Message from IB: Order Event Warning:Attribute 'Outside Regular Trading Hours' is ignored based on the order type and destination. PlaceOrder is now being processed.. Error Code: 2109. ServiceOrderID: 3155. | 2015-04-09 16:38:45
Resetting last order modification Price and Quantity due to an apparent failed order modification. Internal Order ID: 11034 | 2015-04-09 16:38:45
Resetting last order modification Price and Quantity due to an apparent failed order modification. Internal Order ID: 11035 | 2015-04-09 16:38:45
Resetting last order modification Price and Quantity due to an apparent failed order modification. Internal Order ID: 11037 | 2015-04-09 16:38:45
Resetting last order modification Price and Quantity due to an apparent failed order modification. Internal Order ID: 11038 | 2015-04-09 16:38:45

Please let me know if you need more data.
[2015-04-09 16:59:56]
Sierra Chart Engineering - Posts: 104368
There is nothing in the Trade Service Log which is related to this.

You need to contact Interactive Brokers about the problem or disable:

Global Settings >> General Trade Settings >> Use Server-Side OCO and Bracket Orders. This is the only definite solution that we can provide you.

If you are using server side bracket orders, and Interactive Brokers is altering the quantities we can provide 0% help with that.
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: 2015-04-09 17:00:29
[2015-04-09 22:02:50]
i960 - Posts: 360
Go to TWS config, API, check the precautions tab. Is everything checked there? If so, go back to the API settings tab, change logging level to "detail" and wait for it to happen again. When it does, I'd provide the related debugging messages here and/or IB's ticket system.
[2015-04-09 23:20:35]
Sierra Chart Engineering - Posts: 104368
We are not going to look at those debugging messages. Please do not provide them here.
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
[2015-04-09 23:26:20]
i960 - Posts: 360
I'm not saying you have to look at them - some others here also have experience with IB and if something blatantly obvious stands out in the logs then it might highlight an issue with SC or an issue with IB that none of us know yet.

One wouldn't automatically assume SC isn't the problem here just as much as one wouldn't automatically assume IB is the problem here. There is no actual debugging data indicating things either way.

If it's an IB problem then that'll be apparent and he can go talk to IB, but it's not safe to assume anything.
[2015-04-10 12:07:02]
MotoMoto - Posts: 47
FWIW - I occasionally have the same problem. Send in an order with Attached Orders ticked. It trades in IB, eg; +5 contracts, but the OCO orders might only have a sell or buy of 3 contracts.
I have not looked into it as it has not been a major problem but I have noticed it just starting to happen the last few weeks.

[2015-04-10 17:10:29]
Sierra Chart Engineering - Posts: 104368
You can confirm the source of the problem through the Trade >> Trade Activity Log:
https://www.sierrachart.com/index.php?page=doc/doc_TradeActivityLog.php#ViewingHistoricalTA

You will see the order quantity at the time the Attached Orders are submitted to confirm they are correct.
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
[2015-04-13 07:36:01]
corbeste - Posts: 74
The order seems to be executed in 2 parts - for example an order of 333 becomes one fill of 100 and another fill of 233.

There are messages that indicate the attached order is modified but I do not know if this is occurring on the IB or SC side.
But the trigger for this issue is definitely due to a partial fill.
[2015-04-13 07:46:32]
Sierra Chart Engineering - Posts: 104368
Do you have Global Settings >> General Trade Settings >> Use Server-Side OCO and Bracket Orders checked or unchecked?
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
[2015-04-13 07:59:52]
corbeste - Posts: 74
Its checked. I will uncheck and see if the problem persists, but just to confirm, by unckecking this I introduce a possible issue - if my computer is not running, neither the stop nor the limit order will be executed if I do not use server-side OCO. Thats not a big deal for a day trade but I just want to understand the effects of this change.
[2015-04-14 03:38:14]
Sierra Chart Engineering - Posts: 104368
Here is the documentation of how bracket orders work when using server-side bracket orders:
http://www.sierrachart.com/index.php?page=doc/doc_AttachedOrders.html#ServersideBracket
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: 2015-04-14 03:39:48
[2015-04-14 03:48:34]
i960 - Posts: 360
Regardless of whether he uses that setting I think it's obvious here there's potentially an issue when it comes to partial fills. Two people have reported the same thing and also have reported it occurring only recently (within the last few weeks).
[2015-04-14 05:51:11]
Sierra Chart Engineering - Posts: 104368
The issue is on the Interactive Brokers side. And this has been reported to us more than a year ago.
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
[2015-04-14 07:54:47]
corbeste - Posts: 74
So does every other trading software exhibit this same issue with IB or just Sierra Chart? I am a little suspect of the "its their problem" justification. I would like to know more about what the underlying issue is since you appear to be fully aware of it.
[2015-04-14 08:13:25]
Sierra Chart Engineering - Posts: 104368
How would we know what the underlying issue is?

We have no idea what other programs use server-side bracket orders with Interactive Brokers. Probably very little.

You have the full proof within your hands, much more than we do. Look at the Trade >> Trade Activity Log. You can see the order quantities at the time the bracket order is submitted to Interactive Brokers. We have written complete documentation how Sierra Chart works with server side bracket orders and we linked to this in post #11.

You have everything in front of you. You possess a lot more information than we do. And Interactive Brokers has to answer your question.

This is far outside of our jurisdiction.
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: 2015-04-14 08:14:20
[2015-04-14 08:26:11]
i960 - Posts: 360
You guys are way too quick to write off the other side as being the source of the problem - particularly when it comes to IB. What you keep missing is that by putting it on the users to fix the problem with IB you end up costing yourself in potential customers. Obviously if everyone knows it's a well-known IB problem that affects all software they wouldn't be bringing it up to SC specifically. With some people pointing out that things worked fine before and now things are noticeably different it means consider something on the SC side *might* have also changed *or* this issue of partial fills hasn't come to light yet (being that partial fills are less common anyway).

Plenty of other stuff uses server side bracket orders with IB: Ninja, ButtonTrader, BracketTrader, their own TWS client, etc. It's not like their general implementation is broken.

corbeste, MotoMoto: What does TWS show upon the rest of the fill happening? What do the child orders look like? Do they reflect the full fill after that point? Does SC then not reflect what TWS shows?
[2015-04-14 08:29:02]
corbeste - Posts: 74
Your arrogant and dismissive reply assumes that you are using the IB API perfectly - unfortunately I dont have the same degree of faith as you do.

As a former software developer, I find your dismissive attitude highly disconcerting and very unprofessional. I would have been fired for that response in my old profession. Try to remember we are talking about an issue that could have real monetary impact here. Its your job to help your customers, not to find any reason to pass them off.

[2015-04-14 09:08:48]
Sierra Chart Engineering - Posts: 104368
OK, we will provide you more information to give you the information you need so you can understand the source of the problem with confidence.

When it comes to submitting orders through the TWS API, if there is improper use of it, it would result in an order or order set being rejected or the order/ order set being in a stuck state and Interactive Brokers not properly rejecting the order or order set.

In the case of a server-side bracket order, the bracket order set would never go through to a working state if there was a problem with the use of the API. If it is going into a working state, then there is no misuse of the API. In other words, the API is being used perfectly.

So the next thing to look at is all of the orders part of the bracket order in the Trade >> Trade Activity Log. Here are the instructions:
https://www.sierrachart.com/index.php?l=doc/doc_TradeActivityLog.php#ViewingHistoricalTA

When the 3 orders are initially submitted to Interactive Brokers, what is the order quantity of each of them? They should all be the same. Are they?

After the orders are submitted, Sierra Chart has no involvement with them anymore other than modification and cancel actions you perform on the orders yourself. Update: In the case of a trailing stop order, Sierra Chart will modify the price of an order.

Any change with the order status or an orders quantity results in a new log entry added to the Trade Activity Log. Therefore, as soon as an order quantity for one of the orders in the bracket order set changes, you will see a new entry added.

When you see an order quantity change, do you see a preceding line putting the status into a "Pending Modify" state? If not, Sierra Chart did not modify the quantity.

If you manually changed the quantity you would see the "Order Action Source" indicate "user order modification" in the log entry which indicates the modification.

Try to remember we are talking about an issue that could have real monetary impact here.
You are right. You should be talking to Interactive Brokers about this and considering whether you should even be maintaining an account them with a problem like this. You should be communicating to Interactive Brokers in the same way you are communicating to us. They should be immediately on top of this problem.

With Interactive Brokers, do you have access to their programmers like you have access to us getting answers direct from the programmers. Absolutely not. Dealing with them must be a difficult process. That is why we avoid them as much as we possibly can.

All of the communication to us, is all out in the open. We have nothing to hide here. A lot of work has gone into the Trade Activity Log to provide an accurate and complete log of all actions on an order in order for the user, and us if necessary, to debug a problem.

What you keep missing is that by putting it on the users to fix the problem with IB you end up costing yourself in potential customers.
We can tell you, it is our intent to keep the Interactive Brokers users to only those who are experienced and willing to understand the source of problems. If you look at our Interactive Brokers page here we make that clear in more than one place:
http://www.sierrachart.com/index.php?page=doc/IB.php



Plenty of other stuff uses server side bracket orders with IB: Ninja, ButtonTrader, BracketTrader, their own TWS client, etc. It's not like their general implementation is broken.
i960, You have got to be kidding us. Prove that any of these programs use Interactive Brokers server-side bracket orders. To our knowledge Ninja does not and Bracket Trader does not. We do not know about Button Trader. If this is different now, it must mean that something has changed.

You also need to remember that Ninja said they had to open a brokerage in order to support server-side bracket orders! Does not make much sense that they would then at that time go ahead and implement them with Interactive Brokers. None of this is making any sense.


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: 2015-05-01 18:32:17
[2015-04-14 09:17:42]
Sierra Chart Engineering - Posts: 104368
Actually there is one thing that comes to mind that might impact this.

Although we are not sure it applies to a bracket order. There is a parameter called :

long ocaType:

  Cancel on Fill with Block = 1

  Reduce on Fill with Block = 2

  Reduce on Fill without Block = 3

In Sierra Chart we use 3.

Update: We do not think that this is related to the problem because this has to do with reducing the other side of an OCO order when there is a fill of the sibling.


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: 2015-04-14 10:16:53
[2015-04-14 10:51:05]
corbeste - Posts: 74
Thanks for the detailed reply. I'm having a little trouble following the activity log but I am curious to know the expected behaviour on a partial fill - should SC amalgamate the fills into the original order quantity in the UI or will I see (in this example) 4 separate orders rather than 3?


[2015-04-14 11:01:40]
Sierra Chart Engineering - Posts: 104368
should SC amalgamate the fills into the original order quantity in the UI or will I see
Yes since they are from the same order.
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
[2015-04-14 11:13:34]
MotoMoto - Posts: 47
FWIW - I think SC do a great job, and IB has its issues and I accept those.
From http://www.sierrachart.com/index.php?page=doc/IB.php

"IB does not provide the necessary order data feedback to maintain a proper state of an order" - says it all.


In my particular case - I have not seen an instance of the issue repeat itself, and (this is a wild guess) it could simply have a timing issue as to when an order is completely filled and not partially filled and the feeback from IB is not sufficient to SC to accurately show what is happening on the SC screen...even if its correct in IB....sometimes a trade happens in one instance (the entire lot is filled instantly), othertimes its partially filled, then completed, and this causes the problem...hence it does not occur all the time. Which makes it hard to track. Plus I do a lot of manual adjustments.

Each system actually works fine...it is just the cost of the nature of the 2 systems talking that sometimes what is reflected is not reality, but the orders are still at IB.

If I see it again I will record some more info. For my own piece of mind and maybe help to others.

..............
EDIT...managed to replicate the issue in IB.

Entry was to sell 2 with OCO orders. entered with attached orders from SC.
Trade entry into IB looked good for all 3 orders (initial entry and 2 exits (take profit and stop))....
however when the entry was actually executed in IB (the entry was trigged with a move in the instrument)
2 contracts traded but the OCO orders only actually updated for 1 contract WITHIN IB.
Hence I think the entire issue is with IB.
I will see what they have to say. (dont hold my breath!)

....EDIT 2.
after frantically setting and resetting trades trying to replicate the issue today.
Generally it works fine, however, I notice that if an above market buy stop is set to trigger as a trade entry and there is slippage (eg; current price 53.18, buy stop to enter long at 53.24 with OCO orders correctly showing in IB, and it triggers but the trade entry is at 53.26 (ie; there slippage) then the quantity also slips.
Using 2 contracts, when the slippage occurs the OCO orders drop a contract, and visually this certainly appears to happen at IB.



Date Time Of Last Edit: 2015-04-14 15:18:08
[2015-04-16 23:24:33]
i960 - Posts: 360
I'd think if you see the same order quantity counts in both TWS and IB when this happens then it's most definitely an issue on the TWS/IB side.
[2015-05-01 11:15:59]
MotoMoto - Posts: 47
Hi I managed to replicate the error again within TWS and SC for attached orders.
It definitely comes when an originally out of the money limit order gets triggered and has some slippage and is partially filled before being complete, or in this case it was an automated entry from an old spreadsheet.

In trying to track the IB TWS audit trail there appears to be a modify order sent from SC - and this is confirmed by IB as what is happening. This (I hope :)) can only be sent by SC.

I have attached a spreadsheet to show the IB TWS audit trail (I copied and pasted their trail to make it easier to follow along the sheet) and highlighted the orders, getting entered, triggered and confirmed, and then they are modified. After this they trail.

Could SC please have a look and tell me why IB TWS is getting what appears to be a modify order from SC (highlighted in RED) this seems to be causing the problem, and I still hope its a simple switch somewhere.
Thanks.
attachmenttrade issue 29-04-205-external.xlsx - Attached On 2015-05-01 11:15:42 UTC - Size: 23.18 KB - 907 views
[2015-05-01 18:30:24]
Sierra Chart Engineering - Posts: 104368
Could SC please have a look and tell me why IB TWS is getting what appears to be a modify order from SC (highlighted in RED)
As we indicated earlier in this thread, you need to look at the Trade Activity Log and you will see all order modifications logged there. Here are instructions:
https://www.sierrachart.com/index.php?page=doc/doc_TradeActivityLog.php#ViewingHistoricalTA

The reason for the order modification will be stated in the Order Action Source field. So what is the reason for the order modification?

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: 2015-05-01 18:35:48

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

Login

Login Page - Create Account