Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

Order state immutable...
 Post subject: Order state immutable... Post rating: 0   New post Posted: Tue 30 Apr, 2013, 09:54 
User avatar

User rating: 0
Joined: Sun 03 Mar, 2013, 15:45
Posts: 34
Location: China, guangdong
08:49:05 com.dukascopy.api.JFException: Order state immutable @ jforex.WODECELV.onTick(WODECELV.java:119)

what's the "Order state immutable" means???
When error message came out, then my strategy was stopped.



if(order == null){
    engine.submitOrder("MyStrategyOrder",myInstrument,myCommand,0.01,MyLastTick,10,StopLossPrice,TakeProfitPrice);
}else if(order != null){
        if(order.isLong()){
                order.setStopLossPrice(MyWhiteDownLine);
        }else{
                order.setStopLossPrice(MyWhiteUpLine,OfferSide.BID);  //****WODECELV.java:119****
            }
        }


 
The Best Answer  Post subject: Re: Order state immutable... Post rating: 0   New post Posted: Tue 30 Apr, 2013, 12:14 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Firstly, your strategy should always check order state before attempting to change it, see:
https://www.dukascopy.com/wiki/#Order_state
https://www.dukascopy.com/wiki/#Set_Stop_Loss_price/Set_Stop_Loss_to_an_existing_order
Secondly, if you don't want the strategy to stop on JFException, then either handle them in your strategy source code or unselect in platform Tools -> Preferences -> Advanced -> Stop strategies on exception.


 

Jump to:  

  © 1998-2026 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com