[ts-gen] A sampling of OrderStatus from Java API

Ken Feng kfmfe04 at gmail.com
Thu Oct 8 11:21:33 EDT 2009


Here is a brief sample of different OrderStatus that I've retrieved  
through the Java API:

PreSubmitted 4
Submitted 1
Filled 13
Cancelled 39

...but it may not be characteristic of all systems for the following  
reasons:

1. I overwrite the old OderStatus with the newest one by using REPLACE  
INTO
2. My trades are in FX - no stocks or futures
3. I don't pause in between trade submissions - I send batches of them  
in sequence without delay

The PreSubmitted you see are sent to IDEALPRO and have a whyHeld  
designation of "trigger" - I have no idea what that means, but for my  
purposes, I do not care - I just treat them as Submitted.

So in my new system, I have two layers of OrderStatus - the raw one  
which takes all the possible enumerations that we have discussed  
before, and a new status field which simplifies the larger set to just  
Cancel, Closed, Pending, Partial, and Submitted (my own  
designations).  I start as "Pending" even before it is sent upstream.   
If, after some period of time, say one minute after being sent and I  
still see "Pending", it means something strange has happened to my  
order.  In my older Shim set-up, I had several cases of persistent  
"Pending" during the day, even though the TWS GUI shows them as  
"Submitted".  I do not yet know the reason, as nothing showed up in  
Shim's OrderStatus table or in the log files, but as mentioned before,  
a likely cause is a bug in the way I wrote the downstream client.

So far, here are some differences between the Java API and using Shim:

1. No pauses in between sends in the Java API
2. No lost OrderStatus yet in the Java API (probably because the Java  
API is so simple and structured in place, there is no room for error)
3. Java API is very easy to use (so far) - I am going to investigate  
FAs in a few weeks
4. In the Java API, OCA orders work simply
4. Java is a memory hog
5. Shim is much better to use as a cron job

- Ken



More information about the ts-general mailing list