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.

IOrder.close behaviour
 Post subject: IOrder.close behaviour Post rating: 0   New post Posted: Wed 04 Nov, 2009, 07:24 

User rating: 0
Joined: Wed 28 Oct, 2009, 10:25
Posts: 13
Hey,

1. Is the order's state is up to date right after the call for IOrder.close or I should keep checking until the state changes to CLOSED?

2. What are the available states after calling IOrder.close except CLOSED?
What is the state if it is partially closed?
What is the state if the close request is rejected and I should try again?

Thanks.


 
 Post subject: Re: IOrder.close behaviour Post rating: 0   New post Posted: Wed 04 Nov, 2009, 10:42 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
    1) If an order will be rejected, then you won't know this by checking the IOrder.State.CLOSED. To know for sure if an order is closed successfully, it's better to check for the IMessage.Type.ORDER_CLOSE_OK type. Consider attached diagram.

    2)
    • There are two states IMessage.Type.ORDER_CLOSE_OK and IMessage.Type.ORDER_CLOSE_REJECTED;
    • In case when an order is closed partly, the state is IMessage.Type.ORDER_CLOSE_OK;
    • In case when an order is rejected, the state is IMessage.Type.ORDER_CLOSE_REJECTED.


Attachments:
Market Order States Diagram-1.pdf [144.43 KiB]
Downloaded 567 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: IOrder.close behaviour Post rating: 0   New post Posted: Wed 04 Nov, 2009, 10:52 

User rating: 0
Joined: Wed 28 Oct, 2009, 10:25
Posts: 13
Thank you.

So when I close an order the best way is to wait for a message in onMessage.
What is a reasonable timeout to wait for a closing message?


 
 Post subject: Re: IOrder.close behaviour Post rating: 0   New post Posted: Wed 04 Nov, 2009, 17:52 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Yes, wait for message.
Five seconds is a reasonable timeout.


 

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