Cancel/replace behavior

Imported from previous forum

[ original email was from Robert Kulseth - robk@riscinfo.com ]
I am trying to connect to a fix order provider. I have already done this to several other providers. My question is what is the way a Cancel Replace is supposed work. From my past experience it works like this.

Example
Send: day order for 1000 MSFT at $22.00, ClOrdID=1
Receive: execution report with OrderSataus tag = 0(New)

Trader decides he wants to decrease quantity to 999

Send: Cancel replace message with new quantity, ClOrdID=2
Receive: Execution report with OrderSataus tag = E(Pending) , ClOrdID=?
Receive: Execution report with OrderStatus tag = 5(replaced) , ClOrdID=?

And everyone is happy. But my new counter party does the following after receiving the cancel/replace

Receive: Execution report with OrderSataus tag = E(Pending) , ClOrdID=1
Receive: Execution report with OrderStatus tag = 0(New) with my new quantity, ClOrdID=2
Receive: Execution report with OrderStatus tag = 4(Canceled) with my old quantity, ClOrdID=1

So it looks like my counterparty is treating may cancel replace as an entirely new order. Well, my order entry system sees the cancel and removes the order from its UI even though there is a live order out there. So everything looks great to the counterparty, but my client sees no order waiting to be filled. This doesn’t seem like the right way to do this. Can someone please advise me how to take the response I am getting and fake it to look like the response I am used to getting? I guess my main problem is I don’t understand how the orders Id’s are supposed to be handled. Should my replaced order have a new Order ID, or should I use the original one. Also, what ClientOrdID should I expect on further fills and what should I send on further cancel and cancel/replace messages

[ original email was from Sam Matthews - sam@ucs.net ]
>
> I am trying to connect to a fix order provider. I have already
> done this to several other providers. My question is what is the
> way a Cancel Replace is supposed work. From my past experience
> it works like this.
>
> Example
> Send: day order for 1000 MSFT at $22.00, ClOrdID=1
> Receive: execution report with OrderSataus tag = 0(New)
>
> Trader decides he wants to decrease quantity to 999
>
> Send: Cancel replace message with new quantity, ClOrdID=2
> Receive: Execution report with OrderSataus tag = E(Pending) , ClOrdID=?
> Receive: Execution report with OrderStatus tag = 5(replaced) , ClOrdID=?
>
> And everyone is happy. But my new counter party does the
> following after receiving the cancel/replace
>
> Receive: Execution report with OrderSataus tag = E(Pending) , ClOrdID=1
> Receive: Execution report with OrderStatus tag = 0(New) with my
> new quantity, ClOrdID=2
> Receive: Execution report with OrderStatus tag = 4(Canceled) with
> my old quantity, ClOrdID=1
>

My understanding is as follows…

A Cancel Request, like a New Order, always has it’s own ClOrdID and must be unique. In the case Cancel/Replace, the ClOrdID becomes the ID for the new order, whereas in the case of a straight Cancel, it is no longer referenced. Even when you get a ‘Pending’ in response to a Cancel Request, the ClOrdID is that of the Order you are canceling, not the ClOrdID of the Cancel Request message. Same goes for Cancel Reject.

In your example…

> Receive: Execution report with OrderSataus tag = E(Pending) , ClOrdID=1
Pending for the Cancel, ClOrdID is that of original order.

> Receive: Execution report with OrderStatus tag = 0(New) with my
> new quantity, ClOrdID=2
This is about your New Order with ClOrdID = 2, same ID of your Canc/Repl message.

> Receive: Execution report with OrderStatus tag = 4(Canceled) with
> my old quantity, ClOrdID=1
UR OUT on original Order.

It’s very confusing, but I hope this helps. In fact, My only FIX vendor (for a long time) did not handle things this way, but then decided to, causing me to become ‘intimate’ with this very behavior.

Sam Matthews
Global Brokerage Concepts