Commands

__________________________________________________________________________

Command function -- a brief guide:

    help     Display the text you are reading now

    ping     Check connectivity between downstream and the shim
    next       "     "            "     the shim and the tws
    look     Add newly inserted entries of the database to the shim
    load     Load the SubRequest table, adding and deleting subscriptions
    list     List current subscriptions

    wait     Add an n-second bubble to the shim's request queue
    wake     Clear the bubble counter, restarting   "       " 
    quit     Terminate the shim (after waiting on bubble, if any)

    eval     Run a child program, reading commands and returning messages
    sign     Broadcast a signal and its args within a stream group
    text       "       free-form message text  "    "   "      "
    done     Close the IO channels between the shim and the sending child

    verb     Set the tws log level
    news     Subscribe and unsubscribe to news bulletins
    open     Query for open orders
    acct       "    "  the (label, value, currency, account) tuple list
    data       "    "  contract data

    tick     Subscribe and unsubscribe to market data
    book       "       to market depth (cancel currently broken)
    past     Query for historical data (cancel not yet implemented)

    wire     Create, modify, submit or cancel an order
    cash     Exercise an option

The following command verbs are synonyms:

    load and bulk
    acct  "  account
    past  "  history
    wire  "  order
    cash  "  exercise

Note that the bulk and individual subscription commands overlap in
functionality, and that it is safest for now to use one or the other type,
but not both, within a session.  That is, if you use load, consider avoiding
tick, book, and past, and vice versa.

________________________________________________________________________

Command notation -- a brief guide:

Commands begin with the command verb, followed by the parameters, if any,
and terminated -- always -- by a semicolon.

The simplest command verbs have no parameters:

    help    next    list    wake
    open    look    load    bulk
    done

The following command verbs allow whitespace and arbitrary comment text
to follow up to the terminating semicolon -- don't forget it!

    ping    quit

The parameter syntax for most of the remaining commands is minimal:

    wait N;
    verb Level;
    data Cid;
    tick Req Cid I;
    book Req Cid I;
    past Req Cid I;
    cash Act Cid Q Force;
    eval Mode [Group] Path;

    N    : the number of seconds
    Q    :  "  quantity
    Cid  :  "  contract id, a database uid attribute value of Contract
    I    :  "  configuration id, a database table uid, one of, by verb:
           tick: TickConfig
           book: DepthLimit
           past: PastFilter
    Level: one of (System, Error, Warning, Info, Detail)
    Mode :  "  "  (data, risk)
    Req  :  "  "  (add, del)
    Act  :  "  "  (exercise, lapse)
    Force:  "  "  (yes, no)
    Group: a stream group id, or zero for the group parent
    Path : " pathname, the program of which should write commands to stdout
           and accept log-style text on the stdin

The order command, due to the number of api parameters, is more complicated.
Much of the complexity is hidden in the LineItem record, but modifiable
parameters must be provided on the command line.

    wire(Oid,Type,Op,Q,P,Aux,T);

    Oid : the line item id, a database uid attribute value of LineItem
    Type: an order type, e.g., MKT, LMT, STP, or TRAIL
    Op  : one of (Create, Submit, Modify, Cancel)
    Q   : the quantity
    P   :  \"  limit price
    Aux :  \"  auxiliary price
    T   :  \"  timeout (just a dummy for now, not yet used)

For examples, and in any case if this crib sheet is not sufficient,
see the regression tests, in particular the program text of bin/includes.

Note that the execution report, market scanner, option modelling, and all
financial advisor related requests and messages are not yet supported.
Please subscribe to the mailing list and let us know if you need these
features, see:

    http://www.trading-shim.org/mailman/listinfo



Bill Pippin 2010-01-14