Sorry, but I'm not good enough in DDE-issues. In C++ I monitor the orderStatus callback. It is call from the TWS each time the status or the 'fillstatus' of an order changes. So it is quite simple to keep track of the open orders.
I have to change everything I did today... I will see tomorrow... Good night or good afternoon for you in the US.
I found, that IB API can mark partially filled orders as it want: sometimes it "filled", sometimes "canceled", etc. The best way to handle this situation is to check all orders for order.remaining and order.filled parameters. if ( order.remaining > 0 ) and ( order.filled > 0 ) then Do something
To determine if you have been fully filled, simply compare the execution.m_cumQty (if you are using Java) from the execution message of execDetails with the amount that you originally ordered. You should keep getting getting execDetails message each time you get an additional fill until you are fully filled.
Thanks FaceOff too, It's finally working quite well. I had to request executions using "executed" in "ord" req , and then quantify fills using "shares" on "exec" req. There might be a little problem in live if the request is too long and system miss last fills. For whatever reason, the "sharesFilled" DDE link doesn't work. Thank you all.