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.

How do you remove an order that has not yet been filled?
 Post subject: How do you remove an order that has not yet been filled? Post rating: 0   New post Posted: Wed 21 Jul, 2010, 00:59 

User rating: 0
Joined: Wed 21 Jul, 2010, 00:47
Posts: 4
How do you remove an order that has not yet been filled?

engine.closeOrders(IOrder) only closes orders that have been filled.

Here is my dilema:
If you have placed an order. Then an hour goes buy and it has not been filled. As part of your strategy you want to remove the order. How do I remove order?

Thanks


 
 Post subject: Re: How do you remove an order that has not yet been filled? Post rating: 0   New post Posted: Wed 21 Jul, 2010, 14:42 

User rating: 0
Joined: Mon 28 Jun, 2010, 08:19
Posts: 4
engine.closeOrders(IOrder) also allows you to close opened orders. When the order changed its state from created to opened you can use close() to close it (cancel it).


 
 Post subject: Re: How do you remove an order that has not yet been filled? Post rating: 0   New post Posted: Fri 23 Jul, 2010, 08:51 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
to close an order use the IOrder.close() method.
If you want to close a partly filled orders pending part without canceling filled part, then use method IOrder.setRequestedAmount(0).


 
 Post subject: Re: How do you remove an order that has not yet been filled? Post rating: 0   New post Posted: Thu 29 Jul, 2010, 16:35 

User rating: -
How can I close/cancel orders, which have been created but nor submited yet?
I get an exception thrown anytime I try to close a created Order (Order.State.CREATED).
Thx


 
 Post subject: Re: How do you remove an order that has not yet been filled? Post rating: 0   New post Posted: Fri 30 Jul, 2010, 08:07 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can't do this. It's not allowed to close an order when it's in state Order.State.CREATED. Wait until it changes to state Order.State.OPENED.


 

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