rnicoll
unread,Jun 25, 2008, 5:19:40 AM6/25/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jsystemtrader-dev
Just sat down and started looking over the code (I figure I'm better
off hacking at your code than continuing with the mess I've made of my
own attempts)...
First thing I notice, is you're catching Throwable. For example,
com.jsystemtrader.platform.trader.Trader, line 149:
} catch (Throwable t) {
// Do not allow exceptions come back to the socket -- it will
cause disconnects
eventReport.report(t);
}
Which looks perfectly sensible on first glance; we don't want errors
in the strategy getting back to TWS. However... this means, for
example, you're catching OutOfMemoryError, which means it never gets
up to the top of the VM to have it auto-trigger the garbage collector.
You're also catching InternalError, "Thrown to indicate some
unexpected internal error has occurred in the Java Virtual Machine. "
- I don't think at that point the code should be quietly reporting
then dropping, I think it should be shutting down ASAP. Possibly
thinking about closing out all the trades on the way through, but
mostly shutting down.
Anyone object if I start going through these, and modifying them to
catch Exception instead? I don't meant with a search & replace, I
promise to actually check it's valid to make the changes before I do
them!