[ts-general] OPT syntax, and ibc {2}

David tshim at allone.org
Wed May 29 18:58:48 EDT 2013


Hello-

I'm resending this post with some corrections and amplifications ....

After searching the news group, test scripts, and docs I was unable 
to properly ascertain the correct syntax for placing an options order 
and requesting options history.

If anybody can tell me the correct syntax, it would be appreciated. 
The following are an attempt to place an options order and request 
option history.

bind key:TRY_AN_OPTION to oid:1;
create item TestPosition  OPT:SMART:MMM:USD:20140118:CALL:100 
TRY_AN_OPTION MKT 2 0.0 0.0;
submit item TRY_AN_OPTION;

AND

req past OPT:SMART:MMM:USD:20140118:CALL:100 d1 ht:17 2d now new;

[request option price for MMM Smart Route, USD currency, the Jan 18, 
2014 100 strike price Call. I'm requesting Daily bar size (d1), 
Trades, but only during Regular Trading Hours (ht:17),  Most recent 
data (now), with AllK set to (new)]

For syntax reference, I've included a snippet of the 
http://www.trading-shim.org/pipermail/ts-general/2010-November/000813.html 
post below, in attempt to drill down to the correct syntax:
      AskK :- BaseCmd;

   BaseCmd :- ShimCmd
           | PosVerb ReqType

  PosVerb :- 'select' | 'sel' | 'req' | 'add' ;

  ReqType :- SubType
           | SyncReq

  SyncReq :- 'open'                 Semi          #  5, open orders
            | 'past' ConExpr History Semi          # 20, history data

ConExpr :- IbcForm | SymExpr ;

   SymExpr :-  'STK' ':' ConSym
           |  'OPT' ':' ConSym ':' Expiry ':' Right ':' Strike

  ConSym  :- Route ':' Symbol ':' Currency ;

   History :- BarSize HtagUid BarSpan EndTime AllK

  BarSize :- 's1'  | 's5'  | 's15' | 's30'
          | 'd1'

  HtagUid :- 'ht'  ':' Uid;

  BarSpan :- Nat BarUnit  ;

EndTime :- 'now'

# AllK     <- bool finite domain w/members 'new' and 'all' (expired, also)
=========================================================

For a second reference, I've included a snippet of the 
http://www.trading-shim.org/pipermail/ts-general/2010-June/000759.html 
post below:
==========================================================
    PastCmd <- select past ConExpr BarSize HtagUid BarSpan EndTime;

     BarSize <- s1  | s5  | s15 | s30
              | m1  | m2  | m3  | m5  | m15 | m30
              | h1  | d1  | wk  | mon | qtr | yr

     HtagUid <- ht:Uid
         Uid <- \d\d*

     BarSpan <- NatUnit
        Unit <- s | d | w | m | y
         Nat <- \d\d*

     EndTime <- now | YmdT
        YmdT <- ymd_t(%Y%m%d  %H:%M:%S)

     ConExpr <- PidForm | IbcForm | SymExpr
     PidForm <- pid:ProductUid at Route
     IbcForm <- ibc:ContractId at Route
     SymExpr <-  IND:Route:Symbol:Currency
              |  OPT:Route:Symbol:Currency:Expiry:Right:Strike

       Route <- /* an Exchange table 'name' attribute value */
      Symbol <- /* a Symbol      "   'name'   "         "   */
    Currency <- /* a Currency    "   'code'   "         "   */
  ProductUid <- /* a Product     "   'uid'    "         "   */
  ContractId <- /* a Product 'ibc' value and IB contract id */

      Expiry <- %Y%m%d
       Right <- P | PUT
              | C | CALL
      Strike <- \d\d*
              | \d\d*.\d*
              |   \d*.\d\d*

Have a GREAT day!



More information about the ts-general mailing list