Imported from previous forum
Hello everyone,
I need your help on the following question:
After an Order (ClOrdID=A) is sent to the broker through FIX, an OrderCancel (ClOrdID=B|OrigClOrdID=A) is sent to cancel the previous order. Let’s assume that the order get cancelled. So an Execution Report is sent back with ClOrdID=B|OrdStatus=Cancelled. My questions are:
- Does it make sense to send two order status requests: one with ClOrdID=A and another with ClOrdID=B? If so, what I expect from them?
- Should I expect another Execution Report (with ClOrdID=A) from broker side because the status of order A is changed (from new to cancelled)?
Thanks a lot,
Jian
[ original email was from Ryan Pierce - rpierce@taltrade.com ]
> After an Order (ClOrdID=A) is sent to the broker through FIX, an OrderCancel (ClOrdID=B|OrigClOrdID=A) is sent to cancel the previous order. Let’s assume that the order get cancelled. So an Execution Report is sent back with ClOrdID=B|OrdStatus=Cancelled. My questions are:
> 1) Does it make sense to send two order status requests: one with ClOrdID=A and another with ClOrdID=B? If so, what I expect from them?
> 2) Should I expect another Execution Report (with ClOrdID=A) from broker side because the status of order A is changed (from new to cancelled)?
Cancelling an order differs between FIX 4.0 and 4.1. A successful cancel also involves two state changes, not just one, hence two messages are sent. The first message states, “I’m acknowledging the fact that you’ve requested I cancel the order, and I’m working on it.” The second states, “The order has been cancelled.”
Under FIX 4.0, according to the state change matrix in the back of the spec, an Execution is sent with ClOrdID=B and OrdStatus=New(0). If you did a request of ClOrdID=A you will get a response of OrdStatus=Pending Cxl(6). If you did a request of ClOrdID=B you will get a response of OrdStatus=New(0).
Then, when the order is cancelled, you will get an Execution on ClOrdID=A with OrdStatus=Cancelled(4). A status request on ClOrdID=A returns Cancelled(4) and a status request on ClOrdID=B returns Cancelled(4).
This is a literal interpretation of the state change diagram. However, many firms don’t implement cancels like that. There’s a FIX 4.0 clarification document on the FIX web site which discusses this issue in detail, as well as other issues, such as OrdStatus if a trade happens while the order is pending cancel.
Under FIX 4.1, the Execution reports contain an OrigClOrdID. So after you submit the cancel, you will receive an Execution with ClOrdID=B, OrigClOrdID=A, OrdStatus = ExecType = Pending Cxl(6). When the order is cancelled, you will receive an Execution with ClOrdID=B, OrigClOrdID=A, OrdStatus = ExecType = Cancelled(3).