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.

Partially close
 Post subject: Partially close Post rating: 0   New post Posted: Fri 14 Aug, 2015, 12:34 
User avatar

User rating: 2
Joined: Mon 30 May, 2011, 15:41
Posts: 86
Location: Czech Republic, Prague
Hello, I have question about partially closed orders.
If there is no enough liquidity, order can be closed partially only.
Also it is possible close order partially deliberately.
Is is possible detect if partially close was deliberately by user or by system because ie. not enough liquidity?
From code bellow I don't know by which situation was order partially closed.
Thank you.

        if (message.getType() == IMessage.Type.ORDER_CLOSE_OK)
            if( order.getState() == FILLED )
                        // "partially closed"
                        ;


 
 Post subject: Re: Partially close Post rating: 0   New post Posted: Wed 26 Aug, 2015, 15:01 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
To close an order partially strategy can call IOrder.close(double amount);
If an order is partially closed the strategy receives IMessage.Type.ORDER_CLOSE_OK but IOrder.getState() is still IOrder.State.FILLED.
https://www.dukascopy.com/wiki/#Order_state


 

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