[ts-gen] Blowup in Paper Account due to failed reception of OrderStatus 3/3/6 Filled

Ken Feng kfmfe04 at gmail.com
Thu Sep 24 07:49:37 EDT 2009


For those of you who haven't read my previous posts, like usual, let  
me start by saying that I am not blaming anyone;  I am just looking  
for a technical/robust solution to my problems.  I am quite happy with  
the performance and reliability of shim so far.

Today, while paper trading, my shim --risk failed to detect responses  
in OrderStatus through a 3/3/6 after 15:00.  This caused a cascade of  
problems as my system continued to submit orders thinking that nothing  
was filled, when indeed, there were fills, according to TWS.

At first I thought it was a problem with my Ruby code so I looked at  
the OrderStatus table.  However, OrderStatus did not detect any fills  
after 12:30:55, either.  My third check in the .log file for 3/3/6  
confirmed that "Filled" was received by the shim.  So I conclude that  
the IB server did not send me a proper 3/3/6 Filled, for whatever  
reason.  In other words, I can't seem to rely on 3/3/6 or the  
OrderStatus table to detect my fills.

Up until today, I have had sporadic problems detecting fills via 3/3/6  
Filled.  Today was the first big problem as I was away for a while.

What I have found to be reliable so far, is a check is 3/6/2  
CashBalance which I get "for free" when I log in via shim --data every  
five minutes to get a mark-to-market.  Unfortunately, this shows the  
breakdown of assets (eg xxx AUD yyy JPY, etc...) and not a breakdown  
of positions (eg aaa AUDJPY).

However, I have noticed that clicking on the "ACCOUNT" button on TWS  
does show the correct positions in the FX Portfolio section (eg aaa  

QUESTION:  Does anyone know the command to submit to the shim to get  
the same information that is on this screen?

I am thinking of ways to safeguard against problems before submitting  
I take this as a very good and worthwhile experience in paper trading;  
it is much better and safer to delay the sending of orders (err on the  
safe side) than to submit orders based on wrong fill information.

- Ken

More information about the ts-general mailing list