[ts-gen] Order Cancel

Bill Pippin pippin at owlriver.net
Fri Dec 7 11:09:05 EST 2007


Nils,

That last reply was premature and incomplete.  Order cancellation
does indeed seem to be broken, and I'm looking at it now.

Here's a sample based on a modified form of the bracket order regression
test, with a cancel replacing the reversal, and the earlier conversion
from limit to market, to force a fill, deleted:

function bracket                                        # modify test 12.7 
{
BuyOrder='order(3,LMT,Create,2,50.0,0.0,0);'            # AIG
Transmit='order(3,LMT,Submit,2,50.0,0.0,0);'
KillKill='order(3,MKT,Cancel,2,00.0,0.0,0);'

    cmd_shim "$BuyOrder"                ; sleep 4       # optimistic order
    cmd_shim "$Transmit"                ; sleep 4       # send transaction
    cmd_shim 'open;'                    ; sleep 4       # open orders info
    cmd_shim "$KillKill"                ; sleep 4       # reverse position
}

And here's the log output, showing the the IB tws doesn't recognize the
order id [the order status record has been chopped off to fit this post]:
 
1|26| 0|order(3,LMT,Create,2,50.0,0.0,0);|
2| 3|15|1|         3|LMT|BUY|STK.SMART.AIG.
1|26| 0|order(3,LMT,Submit,2,50.0,0.0,0);|
2| 3|15|1|         3|LMT|BUY|STK.SMART.AIG.
3| 3| 6|1|Submitted|0|2|0.0|1344889771|0|0.0|764|
1|13| 0|open;|
2| 5| 1|
3| 5|10|1|AIG|STK||0.0|?|SMART|USD|AIG|BUY|2|LMT|50.0|0.0|GTC| ...
3| 3| 6|1|Submitted|0|2|0.0|1344889771|0|0.0|764|
1|26| 0|order(3,MKT,Cancel,2,00.0,0.0,0);|
2| 4| 1|1|
3| 4| 2|       3| 135|Can't find order with id =:3|
1| 7| 0|quit;|

The log entry lists two order command-request pairs, an order status
message, an open command, open orders request, and open order message,
with a dup for the order status message, and finally the cancel command,
cancel order request, and an error message in reply, saying that there
is no order with an id of 3.

I've pushed an interim release so you can try out the cancellation logic
above, if you want to duplicate the above problem.  More to the point,
I'm looking for the problem and will let you know when I fix it.

Thanks,

Bill


More information about the ts-general mailing list