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.

about IOrder.close() function
 Post subject: about IOrder.close() function Post rating: 0   New post Posted: Thu 06 Dec, 2012, 11:50 

User rating: 0
Joined: Thu 06 Dec, 2012, 11:38
Posts: 5
Location: ChinaChina
assume , An buy stop Order with label "order 1" at 1.3000 was created by the following:
IOrder Order1 = engine.submitOrder("order 1" ,Instrument.EURUSD, IEngine.OrderCommand.BUYSTOP,lots, openprice, slippage , sl , tp);
String label = Order1.getLabel();
String Id = Order1.getId();

and before the order is filled, the order is canceled by calling

Order1.close();

then the order label and id became invalid.
My question is
how can i get the information of a canceled order ?


 
 Post subject: Re: about IOrder.close() function Post rating: 0   New post Posted: Thu 06 Dec, 2012, 12:09 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
forhappytrading wrote:
how can i get the information of a canceled order ?
From its reference, i.e., Order1 object in your case.


 
 Post subject: Re: about IOrder.close() function Post rating: 0   New post Posted: Fri 25 Jan, 2013, 15:33 

User rating: 0
Joined: Thu 06 Dec, 2012, 11:38
Posts: 5
Location: ChinaChina
API Support wrote:
forhappytrading wrote:
how can i get the information of a canceled order ?
From its reference, i.e., Order1 object in your case.

If I have restarted the stategy, the Order1 object does not exist any more.
Can I get the canceled order with some function like the OrderSelect(ticket, SELECT_BY_TICKET) function in MT4 ?


 
 Post subject: Re: about IOrder.close() function Post rating: 0   New post Posted: Fri 25 Jan, 2013, 15:38 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can get it by IEngine.getOrder, see:
https://www.dukascopy.com/wiki/#Close_Orders


 
 Post subject: Re: about IOrder.close() function Post rating: 0   New post Posted: Fri 25 Jan, 2013, 15:52 

User rating: 0
Joined: Thu 06 Dec, 2012, 11:38
Posts: 5
Location: ChinaChina
API Support wrote:


IEngine.getOrder(String label) only returns the order with State of FILLED or OPENED or CREATED. A closed pending order(CANCELED order) can not be accessed by this function.


 
 Post subject: Re: about IOrder.close() function Post rating: 0   New post Posted: Fri 25 Jan, 2013, 15:56 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
therefore you need to use order history, see:
https://www.dukascopy.com/wiki/#Order_history


 
 Post subject: Re: about IOrder.close() function Post rating: 0   New post Posted: Fri 25 Jan, 2013, 16:00 

User rating: 0
Joined: Thu 06 Dec, 2012, 11:38
Posts: 5
Location: ChinaChina
API Support wrote:
therefore you need to use order history, see:
https://www.dukascopy.com/wiki/#Order_history


THANKS, I will try this.


 

Jump to:  

  © 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