Duplicate Order after disconnection with TWS  [SOLVED]

Questions about MultiCharts and user contributed studies.
BS135
Posts: 11
Joined: 05 Aug 2012
Has thanked: 2 times

Duplicate Order after disconnection with TWS

Postby BS135 » 03 Jun 2013

I am using IB TWS. Today I found that the amount I bought was more than expected. After looking at the logs, I found that there was about 20s disconnection between MC and TWS. After reconnection the order was still left in TWS not cleared, as a result duplicate orders were executed, so I bought more than expected.

Is there any way to avoid this problem? For example, let MC to clear the old orders after reconnection?

BS135
Posts: 11
Joined: 05 Aug 2012
Has thanked: 2 times

Re: Duplicate Order after disconnection with TWS

Postby BS135 » 03 Jun 2013

In TWS log, I found the disconnection reason s TWS not receiving any heartbeat. Is it possible that it is caused by MC?

TWS log:
ER 22:04:20:794 JTS-CCPPing-11: Warning: not received heartbeat at 50022000 elapsed:35000
ER 22:04:21:808 JTS-CCPPing-11: It's time to reset the connection.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Duplicate Order after disconnection with TWS

Postby Henry MultiСharts » 03 Jun 2013

Hello BS135,

What are the statuses of the original orders in MultiCharts->File -> New -> Order and position tracker window -> Orders tab?

BS135
Posts: 11
Joined: 05 Aug 2012
Has thanked: 2 times

Re: Duplicate Order after disconnection with TWS

Postby BS135 » 03 Jun 2013

In Order Tab, it shows the orders were cancelled at 10:04:32 PM. But actually MC was disconnected from TWS at that time. See Logs below:

6/3/2013 10:04:37 PM,"Information","","Interactive Brokers","-","Interactive Brokers; Connection to the Interactive Brokers Trader Workstation has been established.",
6/3/2013 10:04:37 PM,"Information","","Interactive Brokers","-","Interactive Brokers; Connection to the Interactive Brokers Trader Workstation has been established.",
6/3/2013 10:04:32 PM,"Information","","Interactive Brokers","-","Connecting to Interactive Brokers Trader Workstation ...",
6/3/2013 10:04:22 PM,"Information","","Interactive Brokers","-","Connecting to Interactive Brokers Trader Workstation ...",
6/3/2013 10:04:22 PM,"Information","","Interactive Brokers","-","Connecting to Interactive Brokers Trader Workstation ...",

TWS logs. The CL orders were not cancelled because it shows that TWS was storing the CL orders on pending page.

BS135
Posts: 11
Joined: 05 Aug 2012
Has thanked: 2 times

Re: Duplicate Order after disconnection with TWS

Postby BS135 » 03 Jun 2013

The TWS logs. Please also take a look at the disconnection problem. It is strange that TWS not receiving heartbeat for 35 seconds.

ER 22:04:31:617 JTS-CCPDispatcher-5053: Storage synced: ReportStorage[Mon, today=true]
ER 22:04:30:000 JTS-CCPDispatcher-5053: Setting time offset to -2206 diff -1617
ER 22:04:30:000 JTS-CCPDispatcher-5053: Position snapshot response received
ER 22:04:30:031 JTS-CCPDispatcher-5053: Restore an order for CL id=1359225773 mod=0 liq=false exec id 77636.1370268270.1
ER 22:04:30:031 JTS-CCPDispatcher-5053: processing live order from cache
ER 22:04:30:031 JTS-CCPDispatcher-5053: not adding order to pending page
ER 22:04:30:031 JTS-CCPDispatcher-5053: Restore an order for CL id=1359225774 mod=0 liq=false exec id 77636.1370268270.2
ER 22:04:30:031 JTS-CCPDispatcher-5053: processing live order from cache
ER 22:04:30:031 JTS-CCPDispatcher-5053: not adding order to pending page
ER 22:04:30:031 JTS-CCPDispatcher-5053: Restore an order for CL id=1359225775 mod=0 liq=false exec id 77636.1370268270.3
ER 22:04:30:031 JTS-CCPDispatcher-5053: processing live order from cache
ER 22:04:30:031 JTS-CCPDispatcher-5053: not adding order to pending page
ER 22:04:30:031 JTS-CCPDispatcher-5053: Restore an order for CL id=1359225776 mod=0 liq=false exec id 77636.1370268270.4
ER 22:04:30:031 JTS-CCPDispatcher-5053: processing live order from cache
ER 22:04:30:031 JTS-CCPDispatcher-5053: not adding order to pending page
ER 22:04:30:047 JTS-CCPDispatcher-5053: Received live orders end marker.
ER 22:04:30:047 JTS-CCPDispatcher-5053: CM Received account reset event for Uxxxxxx.
ER 22:04:30:047 JTS-CCPDispatcher-5053: Proccess end
ER 22:04:30:546 AWT-EventQueue-0: Storing 4 orders on pending page true
ER 22:04:34:789 JTS-EServerSocket-5059: The EBuffer buffer has grown to 6144 bytes
ER 22:04:34:789 JTS-EServerSocket-5059: The EBuffer buffer has grown to 8192 bytes
ER 22:04:34:805 JTS-EServerSocket-5059: SECDEF Sending reqId=FixSecDefReqBySymbol4950 symbol=EUR 2 IDEALPRO CASH
ER 22:04:34:805 JTS-EServerSocket-5059: SECDEF Sending reqId=FixSecDefReqBySymbol4951 symbol=USD 2 IDEALPRO CASH
ER 22:04:34:821 JTS-EServerSocket-5059: SECDEF Sending reqId=FixSecDefReqBySymbol4952 symbol=CL 2 NYMEX FUT
ER 22:04:35:448 JTS-CCPDispatcher-5053: Storing CL on pending page
ER 22:04:35:448 JTS-CCPDispatcher-5053: Storing CL on pending page
ER 22:04:35:448 JTS-CCPDispatcher-5053: Storing CL on pending page
ER 22:04:35:458 JTS-CCPDispatcher-5053: Storing CL on pending page

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Duplicate Order after disconnection with TWS

Postby Henry MultiСharts » 04 Jun 2013

In case the same behavior reappears please send me (support@multicharts.com) the following information:
1) What exact version and build number of MultiCharts are you running? (in MultiCharts go to Help tab-> About)
2) What is the version of TWS you are running ? (TWS Help tab->About->Scroll it down so that we can see the version)
3) MultiCharts logs (if you have not restarted the platform. Logs from the previous run are erased when you start MC).
In MultiCharts go to Help->Feedback->Send logs. Please let me know that you have uploaded the logs.
If you want to send the logs manually please follow this guide: https://www.multicharts.com/trading-sof ... harts_Logs
4) In MultiCharts go to File->New->Open Order and position tracker window-> Orders tab->make sure you are not filtering the information in columns, then go to File->Export to excel.
Please also export the information from the Logs tab and send it to me for analysis.
5) Create a screenshot of Format->Strategy properties->Auto trading tab.
6) Please attach a detailed problem description and highlight the problem on the screenshots.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Duplicate Order after disconnection with TWS  [SOLVED]

Postby Henry MultiСharts » 05 Nov 2014

IB has resolved this issue. The fix is included in Browser Based TWS beta build 948.0h or higher. That is recommend to use the browser based TWS with MultiCharts 9.0 Release 2 builds 10172/10173 or higher. Please update your TWS and MultiCharts to get the fix.

As for the fix in the standalone TWS - it can expected with a couple of weeks. There is no exact ETA for it at the moment.


Return to “MultiCharts”