[ts-gen] Syntax error due to unknown symbol [Was: OrderStatus dups and skips]

Bill Pippin pippin at owlriver.net
Fri Jul 31 17:33:22 EDT 2009


Nils,

About an explanation for the third point in your feedback on last
week's shim:

> 3. There is another error message, which I do not quite understand.
>    I thought this one should work, but it doesn't: 
 
> select tick  FUT:DTB:GBL:EUR:20090908 1;

  ...
 
> Process rule: Compound (tick)
> Syntax error:
> Grammar rule: Compound tick    
> Cursor state: match; text is:
> select tick  FUT:DTB:GBL:EUR:20090908 1;
> -------------------------------------^--

A.  To cut to the chase, the database is out of date for many futures,
including the one of interest here.  Sorry; this is a known issue
and we're working on it.  For now, you'll need to collect symbols
info, either using the api, or by hand from:

    http://www.interactivebrokers.co.uk/contract_info/

and add it to one of the futures symbols load files in the sym
directory; you are free to use sym/A0Fut01.sql .  Those files
are sql insert statements, and you can also use a separate local
file, presumably in the same directory, although you will then
have to also edit sql/load.sql to include a source statement
for your local file.
________________________________________________________________

Now, about how you could have diagnosed this problem on your own:

B.  Whenever a syntax error is signaled immediately after reading a
contract expression in the course of command processing, you should
suspect, besides the possibility of a syntactic error such as a
missing colon, a table lookup failure due to use of an unknown
or mispelled symbol, that is one not occurring in the database.

>  ... contract exists ...
 
You point out that IB has a contract for FUT:DTB:GBL:EUR:20090908,
which is to be expected, yet as noted above, unfortunately the shim's
default database does not include it.

To check this, you can use a contract info query.  The following
queries ask if current contracts exist for your GBL:EUR cross at DTB,
as well as our regression test workhorse of ECBOT:YM.

    select info FUT:DTB :GBL:EUR:20090908 new;  wait  1;
    select info FUT:ECBOT:YM:USD:20090918 new;  wait  2;

Whereas a market data subscription for an unknown symbol leads
to a syntax error, contract info queries for such work fine, as
long as the security type, exchange, and currency symbols are
well defined.

Since the queries are specific, there is only one contract each, and
given the commands above, from the log I can then extract data similar
in part to:

10| 5|GBL|FUT|20090908|0.0||DTB  |EUR|FGBL SEP 09|FGBL|FGBL|56441308|...
10| 5|YM |FUT|20090918|0.0||ECBOT|USD|YM   SEP 09|YM  |YM  |53893055|...

The contract info messages above give us the IB contract id, and from
the sql directory of the unpacked tarball, I can look for each in the
syms.txt table listing produced by the sql query of sql/bin/get_id.sql:

    sql$ grep 56441308 syms.txt
    sql$ grep 53893055 syms.txt
    48161   53893055        FUT     YM      USD     US
    48161   53893055        FUT     YM      USD     US      20090918

So, as noted above, the IB contract 56441308 is not yet in our
database.

Thanks,

Bill



More information about the ts-general mailing list