Alexander this looks about right. One thing that I would do is to disable 
the strategy whose order was rejected. Otherwise, the strategy would try 
again and again, with more rejections generated. Additionally, when an 
order is rejected, it has to be removed from the list and the 
"orderPending" flag has to be cleared. Otherwise, the other strategies 
would not be able to trade. It looks like Klaus handled these conditions in 
the code that he posted above.

On Monday, May 20, 2013 11:31:11 AM UTC-4, Borg Alexander wrote:
>
> Dear Klaus, Judson, Eugene
>  
> I have now implemented a remedy for the problem formulated in my first 
> post of this thread. In TraderAssistant.java, method placeOrder(), replace
>                 
>
> *if* (!portfolioManager.canTrade(strategy.getName(), order.m_action)) *
> return*;
>
> by
>
> *if* (!portfolioManager.canTrade(strategy.getName(), order.m_action)) {
>
>     strategy.getPositionManager().setTargetPosition(0);
>
> *    return*;
>
> }
>
> I have tested this extensively in my simulation account and use it now 
> live. As these situations are relatively rare, I could not verify it in 
> live trading so far.
>
> Alexander
>

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


Reply via email to