[ts-gen] IB contract ids may now be used as part of contract expressions
Bill Pippin
pippin at owlriver.net
Fri Jan 9 20:24:48 EST 2009
Sam suggested last year that the IB contract id be useable to select
contracts, in particular for history queries:
> Another idea, I'm not sure it's easy to implement nor very useful,
> but being able to get historical data directly with the IB contract
> id (ibc) might be interesting too.
I replied at the time that this would be one of the forms of contract
expression allowed once I began extending the command language to
allow alternative forms for contract descriptions. As it has worked
out, it is actually one of the earlier forms to be supported. From
the NEWS:
* Add two new forms for contract expressions, with the prefix
type tags pid: and ibc: , where the immediate argument is a
product id or IB contract id, respectively, either of which
serves to specify an abstract product; and the trailing arg
is of the form "@route". E.g., each of the following serves
to define a market data subscription to STK:SMART:AMAT :
select tick cid: 8 1; # deprecated
select tick pid: 2846 at SMART 1;
select tick ibc: 266093 at SMART 1;
See the example scripts in directory exs for more details.
With this change, the shim contract id form, e.g., cid:8 ,
is deprecated; in the future, once this form has been
eliminated, the ContractRow table, default routing, and
LocalSet all will become unnecessary. Note, however, that
LocalFut is still needed at this point, to validate the
contract expiry; that's a whole 'nother issue.
Furthur work in extending the command language should allow the
use of contract variables and symbolic contract expressions.
Purely symbolic contract expressions would allow the direct use of
forms such as STK:SMART:AMAT or FUT:ECBOT:YM:20090320 . With
contract variables, a bind/let command would allow the user to
declare a variable name and define the contract expr for which
it would stand, and that variable name would be freely useable
wherever a contract expression would be used currently.
E.g.,
let ym = FUT:ECBOT:YM:20090320;
select tick ym 1;
The end result of all this will be that users would no longer need
to look up symbols in sql/syms.txt unless they were trying to track
down a problem.
Note that there have been some minor changes to the database, including
modification of some of the load files, and which are described in the
NEWS file, although the database version has not changed, since the table
structure is still the same.
Thanks,
Bill
More information about the ts-general
mailing list