[ts-gen] Account data query [Was: OrderStatus dups and skips]

Bill Pippin pippin at owlriver.net
Fri Jul 31 15:04:35 EDT 2009


Nils,

About the first point in your feedback on last week's shim:

> 1) "select acct;" seems to be broken, more precisely the position in the
> output (log/shim) is missing. Actually I think this was the case already
> in one of the earlier july versions.  

I'm not sure what you mean by:

     ... the position in the output (log/shim) is missing ...

although if you expect an explicit "select acct" command as part of
test.rb, see (A) below.  Otherwise, if you can give a reproducing script
for the breakage you believe you are seeing, please feel free to do so.

Querying for account data works just fine; each shim session begins with
an account data query, and the resulting log file has the (voluminous)
answers near its top.  The exs/acct script works just fine, and if you
start an interactive shim, you can also flood your stdout with account
data quads to your heart's content, though here, see also (C) below.

Three points:

A.  There is no longer a select acct query in the test.rb script, so
you won't see any other account quads when running that test other
than those from the builtin, hardwired startup query.  The shim cancels
following the query, so your session is back to a clean slate after
it reads those quads.

B.  If you use an interactive shim, and tail the log in another window,
it may seem almost as if nothing happens, since the answer is about the
same as the start up quads.  If you look at the log in a text editor
afterwards, however, you'll see that a direct query following a cancel
does indeed give a new set of replies, and that there are two sets of
account quad sequences in the log.

C.  As with all IB tws api protocol events, the message replies
are async, and so the query is not really a query, but more of a
subscription.  After you get your first set of answers, the IB tws
will not send another for a while, even if you trigger multiple
account data requests via the 'select acct' command, unless you
send a cancel first.  So, after the first account data query,
your followups appear to be ignored unless you've provided a cancel.
I believe the refresh period is about three minutes, although you
can check that for yourself.

In general, when you think you see a problem with the shim, you
probably want to be using the file and save options, so that you
can check the ShimText, cmdinput.txt, shim2tws.bin, and tws2shim.bin
log files; and recall that for the bin files, you can use the
bin/req.filter and bin/msg.filter scripts to translate from binary
to a (rough) text log format. 

Thanks,

Bill


More information about the ts-general mailing list