[ts-gen] Symbol lookup [Was: select bars or tick]
Bill Pippin
pippin at owlriver.net
Tue Aug 18 13:13:30 EDT 2009
Ric,
About subscribing to market price data for BHP Billiton Ltd specifically,
and symbols in general, you should know that contract value expressions
in commands require that the shim do a contract lookup using the values
you've provided as keys, and if the results of that lookup should be
problematic, then Paul's suggestion to fall back to IB contract ids is
a good one.
The general issue of incomplete symbols data in the database is a known
problem, and we're working on it, although solutions may not show up
right away. There is also a specific problem, since the symbol you're
interested in is in the database, and I'll look into that.
> ... can someone point me to the current doc on
> select [info and select] bar ...
As for the best documentation for command syntax, that's currently,
in the exs directory, the scripts tick, info, book, bars, and
risk.rb .
As for the error processing you see for your market data request
for BHP, given, say, the commands:
select tick STK:SMART:BHP:USD 1; wait 2;
cancel tick STK:SMART:BHP:USD; wait 1;
> Process rule: InAction (ConA)
> Process rule: Compound (STK)
> Syntax error:
> Grammar rule: Compound STK
> Cursor state: match; text is:
> select tick STK:SMART:BHP:USD 1;
> ------------------------------^--
> ... [many similar lines deleted]
You do indeed see an error trace due to a failed contract lookup, as
above. Starting at the first error, and for that matter the only
meaningful one, the input, or attribute grammar, action "ConA", that
is the contract lookup action, has failed, and the rest of command
processing for the command fails accordingly. As a general rule, if
the trigger for an error trace of command processing is an attribute
grammar action, signalled by a type tag name ending in a capital A,
then the problem is most likely in the data values supplied, rather
than the syntax itself. It might be an unknown contract symbol, or
a mispelled order key, but the syntax --- not semantic value, but
just the token types --- up to that point is probably not the issue.
> ... the [contract] info [query] for it shows SMART ...
Contract info queries aren't checked against the database;
subscriptions and orders are so tested. This is back to the
general problem of incomplete symbols data in the database,
again an area where we hope to provide real improvements in
one way or another, though it's not an easy problem, and so
not right away.
As for the specific problem of using contract value expressions
such as STK:SMART:BHP:USD to refer to BHP Billiton Ltd, I'll
look into what's happening here.
Otherwise, if you are serious about using a missing symbol before
we provide a more general solution to this problem, you can always
add the unknown symbols to the symbols load files yourself, and
then repopulate the database.
Thanks,
Bill
More information about the ts-general
mailing list