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.

JFException on order close
 Post subject: JFException on order close Post rating: 0   New post Posted: Mon 30 Jan, 2012, 22:01 

User rating: 0
Joined: Tue 17 Jan, 2012, 19:57
Posts: 17
Hello

I am getting an exception for close order during strategy execution on demo account (not on backtest).

com.dukascopy.api.JFException: state is CREATED

Why would one get an exception on a CREATED order ?

That's kind of not very reassuring.

Thanks


 
 Post subject: Re: JFException on order close Post rating: 0   New post Posted: Tue 31 Jan, 2012, 09:33 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
viewtopic.php?f=65&t=356&p=1171
For more on Order states see:
https://www.dukascopy.com/wiki/#Order_state


 
 Post subject: Re: JFException on order close Post rating: 0   New post Posted: Tue 31 Jan, 2012, 21:12 

User rating: 0
Joined: Tue 17 Jan, 2012, 19:57
Posts: 17
Hi

Ok so I see what's happening: an order in CREATED state can not be closed or cancelled , we have to wait until it is in OPENED or FILLED state.
... But still this is not right, when we perform a close it should close or cancel any state without having to do further checks.
Hope this can be fixed , this is useless burden on the strategy coding.

Thanks


 
 Post subject: Re: JFException on order close Post rating: 0   New post Posted: Wed 01 Feb, 2012, 09:42 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can carry out actions on orders only according to order state diagrams given in:
https://www.dukascopy.com/wiki/#Order_state
jfwhites wrote:
But still this is not right, when we perform a close it should close or cancel any state without having to do further checks.
If the order is in state CREATED, then it has not been submitted on the order side yet. If it was allowed to call IOrder.close on such orders, you would send a close request to the server on order which is not there - this would break up the workflow of orders.
jfwhites wrote:
Hope this can be fixed , this is useless burden on the strategy coding.
It is just required to check order state before closing an order. In general you should check order state before doing any action with order.


 

Jump to:  

cron
  © 1998-2025 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