[ts-gen] Trouble with new syntax for stocks
Bill Pippin
pippin at owlriver.net
Wed Mar 18 10:56:32 EDT 2009
Paolo,
About the new contract value expression syntax, and in particular
for non-US stocks, e.g., STK:IBIS:MEO:EUR
> After inserting the line "Locality DE"
> into .shimrc file the new command set works fine here.
Good!
> ... I did look into .shimrc file right after installing the shim
> and did change the value for "Currency" from "USD" to "EUR".
> ... if the originally supplied .shimrc would have included
> a line such as "Locality US" I could probably have noticed it
> on my own and could have tried to change that basic setting ...
> ... it is quite tricky to detect and change basic settings without
> even knowing about their existence ... ;)
True.
> Please consider including that line in future .shimrc files ...
Agreed.
The following is the text of the .shimrc file that I plan to ship
with tarballs for now:
DbmsName mysql
DbmsHost localhost
TableSet testing
UserName shim
Password 0
FeedName tws
FeedHost localhost
FeedPort 7496
ClientId 8
HqPeriod 11
Upstream paper
Currency USD
Locality US
LogFiles log
PollTime 3
The leading whitespace is an email artifact, and *not* accepted by
the shim. Attribute names may be added or deleted from the shim's
configuration language as time goes on, and once deleted, are not
accepted as input, leading to a syntax error and program exit. The
NEWS file should give warning of new and deleted attribute names;
and there is also information about attribute meanings in the file
help.c .
Attribute value pairs have default values, and so are not required
if the default is acceptable; those who want to trim their config
file should feel free to do so. Default values are defined in the
sources in the file data.c, and those lines that may be changed by
the user have, at the right margin, the comment:
/* patchable */
In the list above, DbmsName, DbmsHost, TableSet, UserName, and
Password are all related to the database server connection in
the obvious way; FeedName, FeedHost, FeedPort, ClientId, HqPeriod,
and Upstream, to the IB tws api server connection, mostly ditto;
LogFiles is the log directory path; PollTime, the handshake timeout
interval; and, last, both Currency and Locality have been discussed
already during this thread.
The use of 0 for the PassWord attribute value stands for null,
or the empty password, and is understood as such by the shim.
Users are fully responsible for their own security policy, and the
default value of no password is not meant to suggest that you
leave passwords off of your database accounts. In particular, for
live trading, you should seriously consider setting a mysql
database account connection password. Note that, in contrast,
there is no password protection *at all* for IB tws api connections,
and you should fully understand the network security implications
this has for your site.
The shim does not yet make full use of the Currency and Upstream
attributes; downstream users must spell out the Currency in contract
expression values, and the account class is not currently used.
The history query interval, HqPeriod, is in seconds, is clamped
to at least 10, the IB tws api minimum, and may be used to control
query load sharing given multiple shim connections to the same
IB tws, e.g., a value of 20 would give two shims approximately
50-50 query access. The IB tws is known to block queries that
arrive more frequently than the minimum allowed query interval,
and network jitter has been observed to create such blockages
when a query period of exactly 10 seconds is used.
The ClientId value applies only to risk mode connections, and is a
starting value only, since the IB tws may ignore a proffered client
id; the starting value for data mode sessions is fixed to 1, and the
values from 1 to 7 are reserved for data mode connections. Please
be aware that the client id helps to identify orders, is stored in
the journal, and must be consistent from one session to the next if
cross-session order manipulation is desired; you should probably
leave the risk mode default alone unless you have some good reason
to change it.
> Thanks for the hint I needed !
You're welcome, and congratulations on providing the very first
feedback on the new contract value expressions feature.
Thanks,
Bill
More information about the ts-general
mailing list