# OrderCancelReplace after Partial Fill - Tag38

**URL:** <https://forum.fixtrading.org/t/ordercancelreplace-after-partial-fill-tag38/12092>\
**Category:** General Q&A\
**Tags:** xid\_164467, 42-changes, imported\
**Created:** [October 10, 2008, 6:04pm UTC](https://forum.fixtrading.org/t/ordercancelreplace-after-partial-fill-tag38/12092 "2008-10-10T18:04:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![azmatmohammed\_x](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@azmatmohammed\_x](https://forum.fixtrading.org/u/azmatmohammed_x)\
**Post date:** [October 10, 2008, 6:04pm UTC](https://forum.fixtrading.org/t/ordercancelreplace-after-partial-fill-tag38/12092/1 "2008-10-10T18:04:36Z")

</div>

Imported from previous forum

---

<div class="post-metadata">

**Author:** ![azmatmohammed\_x](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@azmatmohammed\_x](https://forum.fixtrading.org/u/azmatmohammed_x)\
**Post date:** [October 10, 2008, 6:04pm UTC](https://forum.fixtrading.org/t/ordercancelreplace-after-partial-fill-tag38/12092/2 "2008-10-10T18:04:36Z")

</div>

All,

I have a question about how this case should be handled. I looked in the spec and couldn’t find this scenario.

1. I send a NOS (38=74, LIMIT, 44=107.6)
2. I receive ack that it is NEW.
3. I receive a partial fill (38=74, 32=1, 151=73, 44=107.59)
4. I then send a CancelReplaceRequest (44=107.6, 38=74???)
5. I receive a partial fill (38=73, 32=1, 151=72, 44=107.6)
6. I receive a partial fill (38=73, 32=19, 151=53, 44=107.6)
7. I receive a fill (38=73, 32=53, 151=0, 44=107.6).

I think there are a few problems with this. My issue is mostly with #4. When I send out the CancelReplace what should tag 38 be? Should it be 74 (original orderqty) OR should it be 73 (the unfilled quantity)?

And finally the last fill came in with 150=2, 39=2. Should I have received a final partial fill with a quantity of 53 and THEN received a fill?

There might be something wrong with the partial fills because of something we are doing. This is from a simulated exchange that we’ve created in house. I can change both sides, I just want to know how the FIX spec defines this scenario.

thanks!

---

<div class="post-metadata">

**Author:** ![fplpo\_x](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@fplpo\_x](https://forum.fixtrading.org/u/fplpo_x)\
**Post date:** [October 10, 2008, 7:31pm UTC](https://forum.fixtrading.org/t/ordercancelreplace-after-partial-fill-tag38/12092/3 "2008-10-10T19:31:54Z")

</div>

[original email was from Ryan Pierce - [ryan.pierce@lehman.com](mailto:ryan.pierce@lehman.com) ]  
An Order Cancel/Replace Request should always consider order quantity to include any shares already traded. In #4, assuming you only want to trade 74 shares in total, including the 1 share already traded, then 38=74. If you send 34=73, then you would be asking the exchange to reduce the order quantity by 1, and 72 shares would be open which, if filled, will result in 73 shares total trading for that order.

Assuming you don’t want to reduce the total quantity, then in #4 you should send 38=74. Assuming you did that, #5-#7 are incorrect as 38=74, but the LeavesQty’s appear correct for the LastShares values given.

The final trade should have 150=2 and 39=2, at least in FIX 4.2.

Plenty of examples of Cancel/Replace scenarios are in the FIX 4.2 Appendix D.

---

<div class="post-metadata">

**Author:** ![fplpo\_x](https://avatars.discourse-cdn.com/v4/letter/f/7ab992/32.png) [@fplpo\_x](https://forum.fixtrading.org/u/fplpo_x)\
**Post date:** [October 10, 2008, 9:56pm UTC](https://forum.fixtrading.org/t/ordercancelreplace-after-partial-fill-tag38/12092/4 "2008-10-10T21:56:16Z")

</div>

[original email was from sonitta peeler - [sonitta.peeler@bofasecurities.com](mailto:sonitta.peeler@bofasecurities.com) ]  
\> All,

> I have a question about how this case should be handled. I looked in the  
> spec and couldn’t find this scenario.
> 
> 1. I send a NOS (38=74, LIMIT, 44=107.6)
> 2. I receive ack that it is NEW. 3. I receive a partial fill (38=74,  
> 32=1, 151=73, 44=107.59) 4. I then send a CancelReplaceRequest  
> (44=107.6, 38=74???) 5. I receive a partial fill (38=73, 32=1,  
> 151=72, 44=107.6) 6. I receive a partial fill (38=73, 32=19, 151=53,  
> 44=107.6) 7. I receive a fill (38=73, 32=53, 151=0, 44=107.6).
> 
> I think there are a few problems with this. My issue is mostly with #4.  
> When I send out the CancelReplace what should tag 38 be? Should it be 74  
> (original orderqty) OR should it be 73 (the unfilled quantity)?
> 
> And finally the last fill came in with 150=2, 39=2. Should I have  
> received a final partial fill with a quantity of 53 and THEN  
> received a fill?
> 
> There might be something wrong with the partial fills because of  
> something we are doing. This is from a simulated exchange that we’ve  
> created in house. I can change both sides, I just want to know how the  
> FIX spec defines this scenario.
> 
> thanks!

OrderQty should not change, i see when you are sending partial fills you are sending 38=73, this is OrderQty not LeavesQty, so it shouldn’t change, try keeping it as it is and see if it works.

Thanks  
Sonitta

---

<div class="post-metadata">

**Author:** ![amiyaacharya16\_x](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@amiyaacharya16\_x](https://forum.fixtrading.org/u/amiyaacharya16_x)\
**Post date:** [October 11, 2008, 11:38am UTC](https://forum.fixtrading.org/t/ordercancelreplace-after-partial-fill-tag38/12092/5 "2008-10-11T11:38:17Z")

</div>

Till you are getting the Replaced status i.e 150=5, your 38 should not change. When you receive 150=5 and in your 35=G you want to change 38 then after it will maintain the new value in 38.  
As far as partial fill & fills are concern, it effects to Tag# 14,151,30,31 and 32 but not 38.  
Amiya.

> > All,
> > 
> > I have a question about how this case should be handled. I looked in  
> > the spec and couldn’t find this scenario.
> > 
> > 1. I send a NOS (38=74, LIMIT, 44=107.6) 2. I receive ack that it is  
> > NEW. 3. I receive a partial fill (38=74, 32=1, 151=73, 44=107.59) 4. I  
> > then send a CancelReplaceRequest (44=107.6, 38=74???) 5. I receive a  
> > partial fill (38=73, 32=1, 151=72, 44=107.6) 6. I receive a partial  
> > fill (38=73, 32=19, 151=53, 44=107.6) 7. I receive a fill (38=73,  
> > 32=53, 151=0, 44=107.6).
> > 
> > I think there are a few problems with this. My issue is mostly with  
> > #4. When I send out the CancelReplace what should tag 38 be? Should it  
> > be 74 (original orderqty) OR should it be 73 (the unfilled quantity)?
> > 
> > And finally the last fill came in with 150=2, 39=2. Should I have  
> > received a final partial fill with a quantity of 53 and THEN  
> > received a fill?
> > 
> > There might be something wrong with the partial fills because of  
> > something we are doing. This is from a simulated exchange that we’ve  
> > created in house. I can change both sides, I just want to know how the  
> > FIX spec defines this scenario.
> > 
> > thanks!
> 
> OrderQty should not change, i see when you are sending partial fills you  
> are sending 38=73, this is OrderQty not LeavesQty, so it shouldn’t  
> change, try keeping it as it is and see if it works.
> 
> Thanks Sonitta

---

<div class="post-metadata">

**Author:** ![girishkumar49\_x](https://avatars.discourse-cdn.com/v4/letter/g/8491ac/32.png) [@girishkumar49\_x](https://forum.fixtrading.org/u/girishkumar49_x)\
**Post date:** [January 19, 2009, 8:37pm UTC](https://forum.fixtrading.org/t/ordercancelreplace-after-partial-fill-tag38/12092/6 "2009-01-19T20:37:53Z")

</div>

> Hi,  
> What Amiya is telling is right once you receive the replaced ER then you will get your replaced value in TAG 38 in the fix message.  
> Until you dont receive the replace ER the value in tag 38 will be same as it was in new order.

So once the order is replaced you should get 150=5 and 39=1 if the order is partially filled, in this message you will see the replaced order qty (which is 73 as mentioned by you).

Regards,  
Girish.

Till you are getting the Replaced status i.e 150=5, your 38 should not

> change. When you receive 150=5 and in your 35=G you want to change 38  
> then after it will maintain the new value in 38. As far as partial  
> fill & fills are concern, it effects to Tag# 14,151,30,31 and 32 but  
> not 38. Amiya.
> 
> > > All,
> > > 
> > > I have a question about how this case should be handled. I looked in  
> > > the spec and couldn’t find this scenario.
> > > 
> > > 1. I send a NOS (38=74, LIMIT, 44=107.6) 2. I receive ack that it is  
> > > NEW. 3. I receive a partial fill (38=74, 32=1, 151=73, 44=107.59) 4.  
> > > I then send a CancelReplaceRequest (44=107.6, 38=74???) 5. I receive  
> > > a partial fill (38=73, 32=1, 151=72, 44=107.6) 6. I receive a  
> > > partial fill (38=73, 32=19, 151=53, 44=107.6) 7. I receive a fill  
> > > (38=73, 32=53, 151=0, 44=107.6).
> > > 
> > > I think there are a few problems with this. My issue is mostly with  
> > > #4. When I send out the CancelReplace what should tag 38 be? Should
> > > 
> > > # it
> > > 
> > > be 74 (original orderqty) OR should it be 73 (the unfilled  
> > > quantity)?
> > > 
> > > And finally the last fill came in with 150=2, 39=2. Should I have  
> > > received a final partial fill with a quantity of 53 and THEN  
> > > received a fill?
> > > 
> > > There might be something wrong with the partial fills because of  
> > > something we are doing. This is from a simulated exchange that we’ve  
> > > created in house. I can change both sides, I just want to know how  
> > > the FIX spec defines this scenario.
> > > 
> > > thanks!
> > 
> > OrderQty should not change, i see when you are sending partial fills  
> > you are sending 38=73, this is OrderQty not LeavesQty, so it shouldn’t  
> > change, try keeping it as it is and see if it works.
> > 
> > Thanks Sonitta
