Imported from previous forum
[ original email was from Ramesh Kadambi - ramesh.kadambi@nasdaq.com ]
Hi All,
I am trying to code around out of sequence messages coming into the FIX engine and sending messages out to clients to reflect the correct state of the order. I am trying to see if I can get away without re-ordering the messages but to send a message that would in the end result in a correct state.
One of the issues is that when an order is cancelled the UR OUT may arrive before the Partial fills on the order.
I am listing the State Matrices for and order cancellation scenario. As you can see I am not re-ordering the messages but sending an Ord Status and Exec-Type to reflect what I think the status is.
ETT - Exec Trans Type
L Sh - Last Shares
Scenario 1:
T MsgRcv MsgSnt Exec Ord ETT Ord Cum Lvs L
Type Stat Qty Sh
1 Ord(x) 1000
2 Ex(x) PF PF N 1000 500 500 500
3 Ex(x) N PF N 1000 500 500 0
4 Cxl(y,x) 1000
5 Ex(y,x) PC PC N 1000 500 500 0
6 Ex(x) PF PC N 1000 600 400 100
7 Ex(y,x) C C N 1000 600 100 0
8 Ex(x) PF C N 1000 700 0 100
The other option would be to maybe restate the order when the UR OUT was received by the quantity of the cancellation.
Scenario 2:
T MsgRcv MsgSnt Exec Ord ETT Ord Cum Lvs L
Type Stat Qty Sh
1 Ord(x) 1000
2 Ex(x) PF PF N 1000 500 500 500
3 Ex(x) N PF N 1000 500 500 0
4 Cxl(y,x) 1000
5 Ex(y,x) PC PC N 1000 500 500 0
6 Ex(x) PF PC N 1000 600 400 100
7 Ex(y,x) D PF N 700 600 100 0
8 Ex(x) F F N 700 700 0 100
In scenario 2 should we send a cancel reject, followed by an exec restatement instead just a restatement.
Does FIX expect the UR OUT to be sent last or can one send PF after the UR OUT has been sent. In which case I am COMPLETELY WRONG and should reorder the messages appropriately and send them back.
Thanks in advance for all the responces.
Ramesh