Profile Picture

Interactive Brokers Orders Placed but Not Executed

Posted By alpha23 5 Years Ago
Message
Posted Thursday September 20 2012
I ran into an interesting Interactive Brokers issue today: TWS accepted orders from the IB plugin but some orders, not all, were not sent to IB. There is no way to realize this is occurring except to observe that certain orders are not being executed.

One solution is to restart the TWS (a very bad solution). Another is to observe client_OrderStatus to see if placed orders have been sent to IB and to raise an error in RE if not.

Several questions:

1)   Has anyone noticed similar issues?
2)   Were there any changes in the TWSPlugin code from earlier versions that have taken this issue into account (I’m using a modified version of the plugin and do not want to go through the brain damage of testing new code if not required)?
3)   Is there a more efficient way to solve than observing client_OrderStatus?
4)   If no to number 2, can code be included in future releases to handle?

Thanks, Duane
Posted Friday September 21 2012
I don't think there have been any code changes in the TWS plugin to account for this. What build of RightEdge did the source code you used come from?

Thanks,
Daniel
Posted Saturday September 22 2012
I’m not really sure. I checked the AssemblyInfo file and it shows 2010.1.0.0. The sln is dated 5/10/2011 which is probably a good indicator of the build release. Is there somewhere in the files that I can verify?

Thanks, Duane
Posted Sunday September 23 2012
How much did you change in the plugin? You can use a diff tool (I like WinMerge) to look at the differences between our latest version of the plugin and your version. Or you can post or send us the code and I can look at how much of a difference there is.

Thanks,
Daniel
Posted Sunday September 23 2012
Different aspects of the plugin have been changed extensively but nothing that would impact the underlying mechanism of the problem. IB support verified that the order was submitted correctly to TWS but TWS was not sending it to IB. The best solution is to include code that checks that IB has received the order. client_OrderStatus appears to be the best place to implement.

Can code be included in a future release of the plugin to handle?

Thanks, Duane
Posted Wednesday September 26 2012
It's harder to make a change for something we can't test. It sounds like this has started to happen periodically but you can't predict when or what causes it. I also wouldn't be surprised if it doesn't happen in simulated trading.

For the orders that aren't sent to IB, you are saying there is never any client_OrderStatus update for them? So you would recommend that the plugin consider the orders cancelled if it doesn't get an order status update for an order it submitted within a specific amount of time? How long?

Thanks,
Daniel
Posted Wednesday September 26 2012
For the orders that aren't sent to IB, you are saying there is never any client_OrderStatus update for them?


yes, that is correct.

So you would recommend that the plugin consider the orders cancelled if it doesn't get an order status update for an order it submitted within a specific amount of time? How long?


Yes. IB told me that the response is within 1 second but I would design for 10 or 15 seconds just to be on the safe side.

Thanks, Duane


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems