[ts-gen] Experiments with Java API

Ken Feng kfmfe04 at gmail.com
Tue Oct 6 07:21:10 EDT 2009


Hi,

After repeated suggestions by Bill to look at EWrapper.java and the  
sample IB code, I finally found the sample client on the IB site and  
built it.  It looks pretty straight-forward - just implement the  
EWrapper methods, and the code should work.  No worries about forking  
processes or dealing with threads.  I will see how far I can get with  
the Java client and report back.

Two side-notes:

One interesting thing I have found after browsing the IB documentation  
is that OrderStatus seems to have a whole bunch of states, many of  
which are ignored/filtered-out by the Shim:  Cancelled, Inactive,  
Pending, Filled, Partial, PendingCancel, PendingSubmit, PreSubmitted,  
and Submitted.  Some of these I have yet to see in paper trading -  
like Inactive.  But I have definitely seen PreSubmitted and  
PendingSubmit.  In fact, I previously had to look for these in the  
3/3/6 filters through the logs to capture them;  I actually prefer to  
interpret PendingSubmit as Submitted, but this could depend on the user.

I don't know the design decision that went into filtering these other  
states out, but I actually find it useful to have all the states, and  
then leave the interpretation to the Shim user, but that's just my  
personal preference.

Secondly, as a part of my Java experiment, I have created my own  
OrderStatus table and used mysql's REPLACE INTO command.  I've removed  
the uid column and made some other minor tweaks, but this seems to  
work fine for me - I don't care about the history of OrderStatus - I  
only want to know about the very latest OrderStatus.  Again, this may  
be different from Shim's design goals, but this simplification works  
well for me.

I will post more later as I learn more about the Java API...

- Ken




More information about the ts-general mailing list