[ts-gen] Incomplete knowledge of order state [Was: Blowup in Paper Account]
Bill Pippin
pippin at owlriver.net
Mon Sep 28 16:16:39 EDT 2009
Ken,
About an evident failure of your downstream to receive the latest
order status messages from the IB tws, you note that the message
was never received, so that the database is not an issue.
You go on to say:
> ... my crontab logging into shim to do a mark-to-market ...
You have a single, ongoing, *uninterrupted* session, I hope? Order
status messages are by their nature transient events, and if the
shim is not around to receive them when they occur, then that train
has left the station.
You also note:
> I am looking for alternative solutions for Trade/Order Fill
> detection.
You may want to consider the execution report functionality of the
IB tws api. I referred to this in a previous post to you:
http://www.trading-shim.com/pipermail/ts-general/2009-August/000547.html
About your account data:
> However, I have noticed that clicking on the "ACCOUNT" button on TWS
> does show the correct positions in the FX Portfolio section (eg aaa
> AUDJPY).
> QUESTION: Does anyone know the command to submit to the shim to get
> the same information that is on this screen?
The post I gave above talks more about the account data subscription.
I believe you're already familiar with it, so I'm not sure why you're
asking about it. By it's nature, the api does not give the gui layout
you refer to, but you'll see a list of account data quads at the
beginning of every shim session in its log, and those show what's
available. You'll probably need to do some calculations from the
api data before you can reproduce the display the IB tws gui provides.
Your downstream app should be double checking order status against
exec reports, against portfolio position, and so against overall
account status. Orders that are not executed should show up as
open orders. Each of the related message types is mentioned in the
post I refer to above.
You should download and read IB's api guide, and look at the IB java
sample client sources for EReader.java and EClientSocket.java.
Thanks,
Bill
More information about the ts-general
mailing list