Support Board
Date/Time: Wed, 25 Dec 2024 13:54:41 +0000
Flatten in SC not totally working in IB/TWS
View Count: 3250
[2015-11-02 00:57:16] |
John M - Posts: 171 |
Was testing out some SC things with IB/TWS via API communication. TWS accepts and acts on orders placed from SC but when using the -Flatten- button in SC Trade Window, the orders in TWS are cancelled BUT the Open Positions remain Open (!!!). It requires going into TWS to actually close the positions. This is a bit dangerous. Am I missing something?
|
[2015-11-02 01:59:35] |
Sierra Chart Engineering - Posts: 104368 |
Can you consistently reproduce the problem? We need to analyze this particular case to explain why it happened. Provide the Trade Activity Log for the Market Order that the Flatten command sent. Here are instructions: https://www.sierrachart.com/index.php?page=doc/doc_TradeActivityLog.php#TradeActivityLogToSupport 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-11-02 02:21:35] |
John M - Posts: 171 |
ActivityType DateTime Symbol OrderActionSource InternalOrderID ServiceOrderID OrderType Quantity BuySell Price Price2 OrderStatus FillPrice FilledQuantity TradeAccount OpenClose ParentInternalOrderID PositionQuantity FillExecutionServiceID Order 2015-11-01 17:59:16.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:05:52.000 Trade Simulation Mode has been disabled Unspecified None Order 2015-11-01 18:17:33.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:18:17.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:44:17.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:51:55.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 19:10:32.000 Trade Simulation Mode has been enabled Unspecified None It's done this before and that's why I was checking it during low volume overnite hours tonight. this is the TWS trade log BOT 1 ES DEC15 Futures 2068.00 USD GLOBEX 18:19:39 MoFo null 2.02 SLD 1 ES DEC15 Futures 2068.25 USD GLOBEX 18:44:58 MoFo null 2.02 the SLD at 18:44:58 is the sale/close after it did not respond to the Flatten command except for killing the open orders for target price and stop. The BOT was executed from the order sent by SC, Flatten is as previously described, it kills the orders but doesn't close the postitions, must go into TWS to do that. I've seen this before. This particular test was a Buy at market, Target of 8 ticks, Stop of 4 Ticks; I just wanted to verify the oddity I had previously seen on it not closing positions. |
[2015-11-02 02:27:34] |
John M - Posts: 171 |
Here are a couple of screen captures in .png format for the above
Date Time Of Last Edit: 2015-11-02 04:41:58
|
Private File Private File |
[2015-11-02 02:33:14] |
John M - Posts: 171 |
I misspoke, the Buy order was a Limit Bid order, not a Market order. That all executed fine.
|
[2015-11-02 02:41:34] |
John M - Posts: 171 |
and I just did it again, same results. This may be of interest Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 17:59:16 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: 192. | 2015-11-01 18:17:06 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: 193. | 2015-11-01 18:17:06 Unable to Flatten or Reverse because a Position does not exist. Working orders will be canceled | Symbol: ES-201512-GLOBEX | TradeAccount: U124xxxx | 2015-11-01 18:17:18 * Trading Message from IB: Order rejected - reason:No such order. Error Code: 201. ServiceOrderID: 193. | 2015-11-01 18:17:19 Trading Message from IB: Order rejected - reason:No such order. Error Code: 201. ServiceOrderID: 194. | 2015-11-01 18:17:19 Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 18:17:33 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: 195. | 2015-11-01 18:18:02 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: 196. | 2015-11-01 18:18:02 Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 18:18:17 Unable to Flatten or Reverse because a Position does not exist. Working orders will be canceled | Symbol: ES-201512-GLOBEX | TradeAccount: U124xxxx | 2015-11-01 18:44:02 * Trading Message from IB: Order rejected - reason:No such order. Error Code: 201. ServiceOrderID: 197. | 2015-11-01 18:44:02 Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 18:44:17 Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 18:51:55 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: 198. | 2015-11-01 20:34:20 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: 199. | 2015-11-01 20:34:20 Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 20:34:35 Unable to Flatten or Reverse because a Position does not exist. Working orders will be canceled | Symbol: ES-201512-GLOBEX | TradeAccount: U124xxx | 2015-11-01 20:35:15 * Trading Message from IB: Order rejected - reason:No such order. Error Code: 201. ServiceOrderID: 200. | 2015-11-01 20:35:15 Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 20:35:30 from TWS attached as a .png The position most certainly existed, I had to cancel it in TWS. I think the time log will reflect that. Date Time Of Last Edit: 2015-11-02 04:43:55
|
SC TWS problem 1.PNG / V - Attached On 2015-11-02 02:40:23 UTC - Size: 17.46 KB - 355 views |
[2015-11-02 03:04:15] |
Sierra Chart Engineering - Posts: 104368 |
None of this is the information we need it and we cannot answer the question. We need to see all of the Trade Activity Log lines for the Market order generated from the Flatten command. Once again here are the instructions: https://www.sierrachart.com/index.php?page=doc/doc_TradeActivityLog.php#TradeActivityLogToSupport Also refer to the information here: http://www.sierrachart.com/index.php?page=doc/IB.php#TradingRelatedIssues 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-11-02 03:04:38
|
[2015-11-02 03:10:15] |
Sierra Chart Engineering - Posts: 104368 |
First this message does not really make much sense. They rejected an order being submitted, because of the condition that it does not actually exist to begin with. This makes no sense. Trading Message from IB: Order rejected - reason:No such order. Error Code: 201. ServiceOrderID: 193. | 2015-11-01 18:17:19
But in general, messages like these indicate problems with the feedback of order statuses and data from TWS. All of these are typical problems with Interactive Brokers and why it is is essential that they improve the reliability of their systems and much more importantly, adopt the DTC Protocol: Http://www.DTCProtocol.org 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-11-02 03:21:54] |
Sierra Chart Engineering - Posts: 104368 |
Actually, we think you should restart Trader Workstation. It appears to be malfunctioning. We think we can probably deduce the problem from this: Unable to Flatten or Reverse because a Position does not exist. Working orders will be canceled | Symbol: ES-201512-GLOBEX | TradeAccount: * | 2015-11-01 18:17:18 * TWS is not reporting your position in the ES if one actually exist. 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-11-02 03:35:53] |
John M - Posts: 171 |
This has been a consistent problem for several days, not just today. TWS has been restarted over that time period. I can do it again.
|
[2015-11-02 03:45:24] |
John M - Posts: 171 |
ActivityType DateTime Symbol OrderActionSource InternalOrderID ServiceOrderID OrderType Quantity BuySell Price Price2 OrderStatus FillPrice FilledQuantity TradeAccount OpenClose ParentInternalOrderID PositionQuantity FillExecutionServiceID Order 2015-11-01 12:59:10.000 Disconnected from server Unspecified None Order 2015-11-01 12:59:15.000 Connected to server Unspecified None Order 2015-11-01 12:59:20.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 14:51:55.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 17:51:52.000 Trade Simulation Mode has been disabled Unspecified None Order 2015-11-01 17:55:53.000 Trade Simulation Mode has been enabled Unspecified None Order 2015-11-01 17:56:07.000 Disconnected from server Unspecified None Order 2015-11-01 17:59:11.000 Connected to server Unspecified None Order 2015-11-01 17:59:16.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:05:52.000 Trade Simulation Mode has been disabled Unspecified None Order 2015-11-01 18:17:33.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:18:17.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:44:17.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:51:55.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 19:10:32.000 Trade Simulation Mode has been enabled Unspecified None Order 2015-11-01 20:33:50.000 Trade Simulation Mode has been disabled Unspecified None Order 2015-11-01 20:34:35.002 Requesting all orders from trading service Unspecified None Order 2015-11-01 20:35:30.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 20:50:25.000 Trade Simulation Mode has been enabled Unspecified None Order 2015-11-01 21:36:08.000 Disconnected from server Unspecified None Order 2015-11-01 21:38:06.000 Connected to server Unspecified None Order 2015-11-01 21:38:11.000 Requesting all orders from trading service Unspecified None |
[2015-11-02 03:46:57] |
John M - Posts: 171 |
and now to do a little trade one more time. If IB/TWS isn't good for DTC, who do you recommend as fully compatible broker with SC functions? |
[2015-11-02 04:03:53] |
John M - Posts: 171 |
Trade Service Log: Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 20:35:30 Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 21:38:11 Inserted missing order fill for symbol: ES-201512-GLOBEX. Date-Time: 2015-11-01 18:44:58. | 2015-11-01 21:38:11 Inserted missing order fill for symbol: ES-201512-GLOBEX. Date-Time: 2015-11-01 20:35:50. | 2015-11-01 21:38:11 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: 201. | 2015-11-01 21:49:19 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: 202. | 2015-11-01 21:49:19 Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 21:49:34 Unable to Flatten or Reverse because a Position does not exist. Working orders will be canceled | Symbol: ES-201512-GLOBEX | TradeAccount: U124xxxx | 2015-11-01 21:53:00 * Trading Message from IB: Order rejected - reason:No such order. Error Code: 201. ServiceOrderID: 203. | 2015-11-01 21:53:01 Interactive Brokers | Sent reqOpenOrders request | 2015-11-01 21:53:15 screen captures of the TWS activity attached as Private Trade Activity log will follow in next post. At least I'm make a little money for my time :) Date Time Of Last Edit: 2015-11-02 04:41:08
|
Private File Private File Private File Private File Private File Private File Private File Private File |
[2015-11-02 04:04:53] |
John M - Posts: 171 |
Trade Activity Log : ActivityType DateTime Symbol OrderActionSource InternalOrderID ServiceOrderID OrderType Quantity BuySell Price Price2 OrderStatus FillPrice FilledQuantity TradeAccount OpenClose ParentInternalOrderID PositionQuantity FillExecutionServiceID Order 2015-11-01 12:59:10.000 Disconnected from server Unspecified None Order 2015-11-01 12:59:15.000 Connected to server Unspecified None Order 2015-11-01 12:59:20.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 14:51:55.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 17:51:52.000 Trade Simulation Mode has been disabled Unspecified None Order 2015-11-01 17:55:53.000 Trade Simulation Mode has been enabled Unspecified None Order 2015-11-01 17:56:07.000 Disconnected from server Unspecified None Order 2015-11-01 17:59:11.000 Connected to server Unspecified None Order 2015-11-01 17:59:16.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:05:52.000 Trade Simulation Mode has been disabled Unspecified None Order 2015-11-01 18:17:33.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:18:17.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:44:17.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 18:51:55.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 19:10:32.000 Trade Simulation Mode has been enabled Unspecified None Order 2015-11-01 20:33:50.000 Trade Simulation Mode has been disabled Unspecified None Order 2015-11-01 20:34:35.002 Requesting all orders from trading service Unspecified None Order 2015-11-01 20:35:30.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 20:50:25.000 Trade Simulation Mode has been enabled Unspecified None Order 2015-11-01 21:36:08.000 Disconnected from server Unspecified None Order 2015-11-01 21:38:06.000 Connected to server Unspecified None Order 2015-11-01 21:38:11.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 21:47:39.000 Trade Simulation Mode has been disabled Unspecified None Order 2015-11-01 21:49:34.000 Requesting all orders from trading service Unspecified None Order 2015-11-01 21:53:15.000 Requesting all orders from trading service Unspecified None |
[2015-11-02 04:08:41] |
John M - Posts: 171 |
Yes, there seem to be gaping holes in the information from TWS, this is what I have reporting to me in the Trade Activity Log. If IB/TWS isn't DTC compatible all the way, who is as far as SC is concerned ? Thank you. |
[2015-11-02 04:09:44] |
Sierra Chart Engineering - Posts: 104368 |
Based upon the Trade Activity Log in post #11, it looks as though you have not selected the ES-201512-GLOBEX symbol and your Trade Account with IB at the top of the Trade Activity Log. Anyway based upon what we suspect we can analyze this differently. Just before you press the Flatten button go to Trade >> Trade Orders and Positions >> Positions tab. Do you see the Position Quantity there reported correctly for ES-201512-GLOBEX? Overall we think CTS T4 would be the best choice and gives you server-side OCO: http://www.sierrachart.com/index.php?page=doc/CTS_T4.php 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-11-02 04:10:47
|
[2015-11-02 04:17:11] |
John M - Posts: 171 |
The only trades I have done today are the test ES-201512-GLOBEX and all the accounts are selected even tho it has been in just one account. I'll check that trade orders thing. |
[2015-11-02 04:24:45] |
John M - Posts: 171 |
Trade Orders and Positions Log Entry Time Last Activity Time Symbol Status Internal Order ID Order Type Buy/Sell Open/Close Order Quantity Price Price 2 Filled Quantity Average Fill Price Parent Internal Order ID Time in Force Good Till DateTime Service Order ID Trade Account Link ID OCO ID LastOrderActionSource Client Order ID 2015-11-01 20:34:20 2015-11-01 20:45:31 ES-201512-GLOBEX Filled 9628 Limit Buy Open 1 2066.75 0.00 1 2066.75 0 Day 198 U124xxxx 9628 0 IB order status update 2015-11-01 20:34:20 2015-11-01 20:45:31 ES-201512-GLOBEX Canceled 9629 Limit Sell Close 1 2068.75 0.00 0 0.00 9628 Day 199 U124xxxx 0 9629 IB order status update 2015-11-01 20:34:20 2015-11-01 20:45:31 ES-201512-GLOBEX Canceled 9630 Step Trailing Stop Sell Close 1 2065.75 0.00 0 0.00 9628 Day 200 U124xxxx 9630 9629 IB order status update 2015-11-01 21:49:19 2015-11-01 21:49:31 ES-201512-GLOBEX Filled 9631 Limit Buy Open 1 2066.00 0.00 1 2066.00 0 Day 201 U124xxxx 9631 0 IB order status update 2015-11-01 21:49:19 2015-11-01 21:53:01 ES-201512-GLOBEX Canceled 9632 Limit Sell Close 1 2068.00 0.00 0 0.00 9631 Day 202 U124xxxx 0 9632 IB order status update 2015-11-01 21:49:19 2015-11-01 21:53:01 ES-201512-GLOBEX Canceled 9633 Step Trailing Stop Sell Close 1 2065.00 0.00 0 0.00 9631 Day 203 U124xxxx 9633 9632 IB order status update 2015-11-01 22:17:52 2015-11-01 22:20:54 ES-201512-GLOBEX Filled 9634 Limit Buy Open 1 2065.75 0.00 1 2065.75 0 Day 204 U124xxxx 9634 0 IB order status update 2015-11-01 22:17:52 2015-11-01 22:21:59 ES-201512-GLOBEX Canceled 9635 Limit Sell Close 1 2067.75 0.00 0 0.00 9634 Day 205 U124xxxx 0 9635 IB order status update 2015-11-01 22:17:52 2015-11-01 22:21:59 ES-201512-GLOBEX Canceled 9636 Step Trailing Stop Sell Close 1 2064.75 0.00 0 0.00 9634 Day 206 U124xxxx 9636 9635 IB order status update Date Time Of Last Edit: 2015-11-02 04:39:47
|
[2015-11-02 04:34:28] |
John M - Posts: 171 |
Symbol Quantity Trade Account Trade Service Average Price Trade Service Position Quantity ES-201512- 1 U124xxxx 103287.50000 1 I masked the account number, it was accurate. The position was there from the trade going off from an SC order, Flatten killed the orders but the position remained Open and in the list until it was Closed via TWS, SC Flatten did not close the position in TWS. |
[2015-11-02 08:15:01] |
Sierra Chart Engineering - Posts: 104368 |
The Symbol is incorrect. It does not include the exchange. Also the Average Price is incorrect. IB TWS is providing incorrect Position data. This is the source of the problem.
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-11-02 08:15:54
|
[2015-11-02 18:41:36] |
John M - Posts: 171 |
Hello again I just spent an hour+ with the TWS support people going thru things to sort out the Flatten issue between SC and TWS. They would be happy to work with you to get it working. The Chat that this discussed in is attached as a PDF Please read this and get in touch with them, this can be sorted out. Update me as you know things -please- Thank you. |
Attachment Deleted. Private File |
[2015-11-03 04:55:51] |
Sierra Chart Engineering - Posts: 104368 |
As a matter of policy, we will not review external communication of this type. Although we did have a quick look at the end if it, and it contains the usual irrelevant information. We have our own method of troubleshooting this problem. The first step we want you to perform is to update Sierra Chart to the current version by following the instructions here: http://www.sierrachart.com/index.php?page=doc/download.php#FastUpdate Make sure your current telephone number is set here: https://www.sierrachart.com/usercp.php?page=ManageAccountInfo When you have the problem, let us know and be available for a call within two hours of when it happens. 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-11-03 08:04:34] |
Sierra Chart Engineering - Posts: 104368 |
After updating Sierra Chart set Global Settings >> Data/Trade Service Settings>>Data and Other Settings >> Output Debugging Messages to True. We will need that information being logged. You may also want to follow through this information here to get logging for Interactive Brokers: http://www.sierrachart.com/index.php?page=doc/IB.php#ProvidingTWSLogFiles 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-11-04 01:09:39] |
John M - Posts: 171 |
Here are the logs from TWS. The order was BUY at MKT 1 ES, Target 16 tic, Stop 8 tic Step Trail Stop the Buy order executed. Flatten button was hit, Target orders were cancelled, position remained open. I had to manually sell the position in TWS. I have all that captured step by step in screen shots. I presume you can get the Debugging messages for SC, if not let me know. Thank you. Date Time Of Last Edit: 2015-11-04 01:33:39
|
[2015-11-04 01:50:10] |
Sierra Chart Engineering - Posts: 104368 |
We now have the information we need to resolve this for you. You can now set Global Settings >> Data/Trade Service Settings>> Data and Other Settings >> Output Debugging Messages to False. We will try to have the changes out by morning. For the record this relates to a Financial Advisor account and we are going to make some changes to apply standard Trade Position data handling for that account type. 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 |
To post a message in this thread, you need to log in with your Sierra Chart account: