Posted 11/22/2010 02:24:04
|
|
|
|
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 11/22/2010 02:37:37
|
|
|
|
| Oh, and also with above circumstance , the filled order doesn't automatically get closed right? (e.g. we have to close them manually)
|
|
Posted 11/22/2010 12:10:49
|
|
|
|
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 11/22/2010 15:47:03
|
|
|
|
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 (E.g. set cancel flag and pray...)
|
|
|
|