Profile Picture

Cancelling partially filled order?

Posted By felixtjung 7 Years Ago
Message
Posted Monday November 22 2010
Hi,

Just to confirm something, suppose if I have an order attached to a position. Let say, the order (size=100) is already filled partially (filled size = 50). What will happen if I cancel this order? Will the partially filled "Trade" still be calculated correctly? And what would be the state of the Order (BrokerOrderState.Cancelled or BrokerOrderState.PendingCancel)?


Thanks,
Felix
Posted Monday November 22 2010
Oh, and also with above circumstance , the filled order doesn't automatically get closed right? (e.g. we have to close them manually)
Posted Monday November 22 2010
Yes, any fill received (partial or not) results in a trade being created on the position. If the rest of the order is subsequently cancelled it won't affect the already filled part of it. I don't believe the PendingCancel state is actually used (and it is going to be removed in the next major version). When you call CancelOrder, the CancelPending property of the Order object will be set to true. Then, when the broker acknowledges that the order has been cancelled, the order state will be set to Cancelled.

The partially filled order will result in an open position, and the open position won't automatically get closed if a partially filled entry order is cancelled.

Thanks,
Daniel
Posted Monday November 22 2010
Hi,

I think i got it. Thanks a heap for a great support!

Felix

P.S: It's funny how cancel implementation in RightEdge use similar concept compared to my cancel implementation Tongue (E.g. set cancel flag and pray...)

Edited: Monday November 22 2010 by felixtjung


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems