[ts-gen] create & modify orders
Paul C
paulq2o0 at yahoo.co.uk
Wed Apr 16 05:41:50 EDT 2008
On Tue, Apr 15, 2008 at 10:32:36PM +0200, Nils Gebhardt wrote:
>
> Hello,
>
> I am still struggeling with the transition from old to new wire command
> format.
>
>
> > > ... In the most recent 'bin/includes' are commands of the form:
> >
> > > create item 12 3 LMT 2 50.0 0.0;
> >
> > > ... previously the "12" ^^ was not present. My understanding is
> > > that this is a limit order to buy 2 lots of AIG at price 50.0; and
> > > that it's AIG because it references row "3" in the "Template" table,
> > > which in turn (pid=2) references row 2 in the "Position" table: this
> > > ultimately deriving its entries from risk.sql. But I'm not sure about
> > > the "12".
> >
> > You noted that the contract id of 12, for AIG, was previously not present,
> > and that it is currently redundant, both true. It is needed currently,
> > however, to keep the parser happy; and in the future for semantics as
> > well, since the current line item index will be replaced with an order
> > Template record specifier in its place.
>
> Seems to be clear. However, all I get is - for example for ext/wire
>
> Scan: 14 17 0 <LMT>
> 2 Term: mod TmpK (nil)
> 3 Grammar rule: Terminal (TmpK)
> 4 Grammar rule: Compound (mod)
> 5 Syntax error:
> 6 Cursor state: match; text is:
> 7 create item 1 LMT 2 40.00 0.0;
> 8 -----------------^------------
> 9 Grammar rule: Compound (create)
> 10 Syntax error:
> 11 Cursor state: match; text is:
> 12 create item 1 LMT 2 40.00 0.0;
> 13 -----------------^------------
> 14 Scan: 12 13 1 <1>
> 15 Term: submit TmpK (nil)
> 16 Grammar rule: Terminal (TmpK)
> 17 Grammar rule: Compound (submit)
> 18 Syntax error:
> 19 Cursor state: match; text is:
> 20 submit item 1;
> 21 -------------^
> 22 Terminal tag: name:TmpK index:3
Maybe you are not using the "bind" command before the "create"? The
example below seems to work. I've used strings "one" and "two", but
they could be anything. I think the "12" is currently a dummy
parameter that just needs to be there. Probably somebody will give a
better explanation later, but hopefully this will work:
#!./shim -f
#
bind key(one) to oid(1);
bind key(two) to oid(2);
create item 12 one LMT 2 40.00 0.0; wait 1;
#odify item 12 one MKT 3 0.0 0.0; wait 1;
submit item one; wait 1;
create item 12 two LMT 2 45.00 0.0; wait 1;
#odify item 12 two MKT 3 0.0 0.0; wait 1;
submit item two; wait 1;
exit;
regards,
Paul C
>
>
> exs/wire looks slightly different as the bin/include "unsafe" functions.
> I tried different combinations, all the same output. Database is freshly
> set up and has the required items in Templates and Position tables.
> Any hints?
>
> regards
>
> Nils
>
> _______________________________________________
> ts-general mailing list
> ts-general at trading-shim.org
> http://www.trading-shim.org/mailman/listinfo/ts-general
More information about the ts-general
mailing list