> 08/04/11        20:08:19.001    nzd     Placing order 23
> 08/04/11        20:08:19.195    IB API  202: Order Canceled - reason:Can't
> handle
> negative priced order (for id 23)
>
>
That's an interesting one. No references to it on the web, so it sounds like
it's very rare. I have to admit that I have no idea why this would happen.
Yes, there is a way to handle this by processing this error. Add this code
anywhere in the error(int id, int errorCode, String errorMsg) method of
Trader.java:

            if (errorCode == 202) { // Order Canceled - reason:Can't handle
negative priced order
                traderAssistant.getOpenOrders().remove(id);
                traderAssistant.resetOrderExecutionPending();
                String reportMsg = "Removed order " + id + " because IB
reported error " + errorCode + ". ";
                reportMsg += "Another order will be submitted. The strategy
will continue to run normally";
                eventReport.report(JBookTrader.APP_NAME, reportMsg);
            }

This should work. However, there is no way to test it unless it happens
again.

-- 
You received this message because you are subscribed to the Google Groups 
"JBookTrader" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jbooktrader?hl=en.

Reply via email to