[ts-gen] Cancel Order and OCA Orders

Ken Feng kfmfe04 at gmail.com
Fri Aug 7 14:26:59 EDT 2009


Hi,

When I try the following 4-liner, the order is created and sent, but
for some reason, cancel doesn't work (1-3 ok).  Any idea why?

I'm getting a syntax error on a compound item, but I'm having a very
hard time figuring out how to fix this...

# -------------------------------------
bind key:foobar1 to oid:1;
create item humanreadableID ibc:15016133 at IDEALPRO foobar1 LMT 50000
79.500 0.0;  wait 0.2;
submit item foobar1;
cancel item foobar1;
# -------------------------------------
cancel item foobar1;
Process rule: InAction (TicA)
Process rule: Compound (item)
Syntax error:
Grammar rule: Compound item
Cursor state: match; text is:
cancel item foobar1;
-------------------^
Drop: ;

Del;

-------------------------------------------------------------------------------------------------------------------
A couple of sidenotes:

While playing with orders on a paper account, I like to wipe some
tables clean so I can better see and understand what's going on as I'm
learning how to use the shim.  These SQL statements seem to clean
things up:

DELETE FROM ActiveOrder;
DELETE FROM ChangeOrder;
DELETE FROM CreateEvent;
DELETE FROM OrderStatus;
ALTER TABLE ActiveOrder AUTO_INCREMENT = 1;
ALTER TABLE ChangeOrder AUTO_INCREMENT = 1;
ALTER TABLE CreateEvent AUTO_INCREMENT = 1;
ALTER TABLE OrderStatus AUTO_INCREMENT = 1;

You obviously don't want to do this on a live-trading table.

One other question - if anyone has an example of an OCA order, where
if one is filled all others are cancelled, please post the shim
script.  I see the OCAType table in the database - hoping that it has
been implemented in the code already.

Thx.

- Ken


More information about the ts-general mailing list