[ts-gen] Java API and Random Ramblings [Was: Speculation about lost order status messages]

Ken Feng kfmfe04 at gmail.com
Thu Oct 8 00:37:08 EDT 2009


Hi Bill,

As always, I appreciate your coding suggestions and your kind words  
(and your fantastic detailed explanations of architecture).

Luckily, I don't have Russ' attitude of "taking poison" in my choice  
of tools.  In my personal programming, I try to be as indifferent as  
possible to what tools/languages I use, although I certainly do have  
preferences.  Even asking other members of this board what approaches/ 
languages others have used has yielded some very educational  
responses!  Typically, I will just "use whatever works", with a goal  
of getting it working ASAP (which may be different from getting it  
"done" ASAP).  Of course, this has some ugly side-effects - like  
having to recode an algorithm in several languages - but I learn to  
live with it.

I've moved from the original Mac  in '84 to Windoze to SunOS/Solaris  
to RedHat and now, I use Ubuntu and OS X.  I went from C to Smalltalk  
to C++, and later to Java and C# and R, so Smalltalk-like languages  
like Ruby and Objective-C do have a place in my heart.  I hate to  
admit it, but I do like C++ (I use it for my backtesting simulator),  
when I can get it to do what I want...

I see myself as lucky, having the freedom to use what is necessary to  
get the job done.

Back to the Java API:  I was stuck for a few hours due to improper  
setting of decimal places for STP and LMT for the Java API (don't set  
too many or the server will not be happy), but other than that, I  
think I may have it working the way I like.  This is after four days  
and nights of non-stop Java coding.  I'm certain that, without the  
experience and the advice I have picked up from you and Russ and  
everyone else on this message board, it would have taken an additional  
several weeks.  Thanks all around!

So far, it looks like I have the following working under the Java API:

Submit - STP, LMT, STPLMT
Cancel
OCA

After lunch, I will hook up the rest of the system and monitor  
OrderStatus carefully over the Paper account.  One interesting thing  
I've noticed is that I haven't had to set any delays between orders  
sent, but I am way below IB's 50(?)/sec limit.  Overall, the system is  
surprisingly responsive.  I guess it's hard for me to exorcise the  
bias that "Java is slow" from the olden days when Java was just  
introduced on machines without sufficient CPU or memory.

BTW, I didn't mean to sound glum in the last message - I still support  
the Shim fully - it's sitting in my crontab to pull down ticks, and to  
do periodic pulldowns of assets in the portfolio.

If I do observe any peculiarities, I will definitely post to the  
board.  I did notice, recently, that if my LMT or STP is too far from  
the market, I do get a PreSubmitted OrderStatus.  I am not certain,  
but I think it may mean IB has warehoused the order and not really  
"sent it to the exchange yet".

- Ken


On Oct 8, 2009, at 4:56 AM, Bill Pippin wrote:

> Ken,
>
> About using the Java sample client:
>
>> As I have been stuck too long at this last piece of getting the whole
>> system working, and I am not confident that I have the expertise to
>> manipulate low-level Ruby or C correctly, especially in the presence
>> of threading code, I will take a short hiatus from that part of the
>> Shim and see if I can get this last piece (Risk) working through the
>> Java API.
>
> Please note that you don't need to use threads with the ruby sample
> client; just add other IO channels to the select array, and add a
> case to absorb the input when it is ready for that channel.  I don't
> view ruby code as low-level, and hope that the ruby sample client
> will solve concurrency issues for other users, though YMMV.  Please
> note also that downstream users should be able to avoid C entirely,
> whatever system they use, and finally, that where threads are optional
> and undesirable with ruby, you will definitely be working with a
> threaded system if you adapt the IB java sample client.
>
> In any case, good luck with IB's sample client sources; you should use
> whatever language and implementation you are most comfortable with.
> Let me take this opportunity to thank you for a number of very useful
> feature and bug reports.
>
> Thanks,
>
> Bill
>
> _______________________________________________
> ts-general mailing list
> ts-general at trading-shim.org
> http://www.trading-shim.org/mailman/listinfo/ts-general



More information about the ts-general mailing list