You can carry out actions on orders only according to order state diagrams given in:
https://www.dukascopy.com/wiki/#Order_statejfwhites 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.