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.

The Partial Filling Nightmare
 Post subject: The Partial Filling Nightmare Post rating: 0   New post Posted: Wed 06 Jan, 2010, 23:15 

User rating: 0
Joined: Thu 17 Sep, 2009, 23:29
Posts: 7
Hi,
First of all, happy New-Year to all the support team, full of new projects and easy-to-fix small bugs... :mrgreen:

I have a question about strategies programming. Let assume this situation :
A BuyLimit order with an attached TakeProfit is hit, and the order is partially filled.
Then the price goes back up and hit the TP, which is unfortunally also partially filled so the order is partially closed.
Thus my order spilts in 3 parts:
1) the still pending unfilled part
2) the filled and not closed part
3) the closed part
The order is still one and only one object, so I do not have any access to those parts.
From the "CLOSED" state, I can know that the TP was hit.
Unfortunally, there is no such thing as "filledAmount", nor "closedAmount"
What wil be returned by getAmount() ? (the size of the closed part, the size of the unclosed part, or the size of the filled part before the partial closing ?)
How can I know that the TP was partially filled ?
Is it right that requestedAmount remains always the size of the initial pending order ?, even when some part is filled or closed ?

Thank you very much for your help,
Michel


 
 Post subject: Re: The Partial Filling Nightmare Post rating: 0   New post Posted: Thu 28 Jan, 2010, 12:12 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
1. when pending order has some partially filled part it becomes FILLED state getRequestedAmount() retruns amount you requested, getAmount() returns filled amount
2. if you cancel pending part with setRequestedAmount(0) or with hands, order will return getRequestedAmount() == getAmount()
3. if filled part gets closed because of stop loss or take profit or any other reason, then order becomes OPEN state with correct getOrderCommand() for pending order. getRequestedAmount and getAmount will return only amount for pending part


 

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