# How we can change Tags Sequence when we send Request to PSE

**URL:** <https://forum.fixtrading.org/t/how-we-can-change-tags-sequence-when-we-send-request-to-pse/14889>\
**Category:** General Q&A\
**Created:** [January 31, 2020, 8:00am UTC](https://forum.fixtrading.org/t/how-we-can-change-tags-sequence-when-we-send-request-to-pse/14889 "2020-01-31T08:00:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![manishdodiya](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@manishdodiya](https://forum.fixtrading.org/u/manishdodiya)\
**Post date:** [January 31, 2020, 8:00am UTC](https://forum.fixtrading.org/t/how-we-can-change-tags-sequence-when-we-send-request-to-pse/14889/1 "2020-01-31T08:00:38Z")

</div>

Limit order  
Request  
8=FIXT.1.1|9=170|35=D|34=16|49=135|52=20200131-05:12:20.270|56=PSE|1=13501100|11=1580447539833|38=100|40=2|44=10|54=1|55=AGI|59=0|60=20200131-13:12:20.254|447=C|448=13501100|452=12|453=1|10=033|)

For example above is my request but i need to change my tags places (means send my sequence)  
Please try to arrange Parties Component Block in the following order:

1. 453
2. 447
3. 452

453=1|447=C|452=12|

Please check in screenshot, we have add sequence according above details but Request automatically change their order(sequence of Tags).

 ![PSE%20Request%20Sequence](https://canada1.discourse-cdn.com/flex010/uploads/fixtrading2/original/1X/f67ba7ef2af5a0f9e186960560855946ff9487d3.png)

---

<div class="post-metadata">

**Author:** ![hanno.klein](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.fixtrading.org/hanno.klein/32/38_2.png) [@hanno.klein](https://forum.fixtrading.org/u/hanno.klein)\
**Post date:** [January 31, 2020, 8:30am UTC](https://forum.fixtrading.org/t/how-we-can-change-tags-sequence-when-we-send-request-to-pse/14889/2 "2020-01-31T08:30:03Z")

</div>

Your request shows three different sequences:

1. tag=value syntax shows 447-448-452-453
2. numbered list (followed by tag=value syntax) shows 453-447-452 (448 is missing on that list)
3. code snippet from screenshot shows 453-447-452-448

The correct order to be FIX compliant has to be 453-448-447-452.

The code snippet sends 448 as last item but has to do so as second element. I suggest to change the ordering in your source code accordingly.

If I have misunderstood you and your question is why the wire format ordering (sequence #1) is different from your source code offering (sequence #3) then I do not have an answer. I do not understand your statement _Request automatically change their order(sequence of Tags)_. I am assuming that _Request_ is your source code in the screenshot and that the sequence does not change unless your newOrderSingle.setField routine is not working properly when adding fields to a message buffer.

---

<div class="post-metadata">

**Author:** ![manishdodiya](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@manishdodiya](https://forum.fixtrading.org/u/manishdodiya)\
**Post date:** [January 31, 2020, 9:09am UTC](https://forum.fixtrading.org/t/how-we-can-change-tags-sequence-when-we-send-request-to-pse/14889/3 "2020-01-31T09:09:20Z")

</div>

My question is I need to change ordering, how i can do manually. Because which i have add tag before and after its automatically create sequence of Tags…I need to create my sequence of Tags request how it possible. Please suggest…

---

<div class="post-metadata">

**Author:** ![hanno.klein](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.fixtrading.org/hanno.klein/32/38_2.png) [@hanno.klein](https://forum.fixtrading.org/u/hanno.klein)\
**Post date:** [January 31, 2020, 9:14am UTC](https://forum.fixtrading.org/t/how-we-can-change-tags-sequence-when-we-send-request-to-pse/14889/4 "2020-01-31T09:14:34Z")

</div>

I think you have a software problem that requires detailed debugging to find out where the ordering of the wire format is changed. However, I note again that your code snippet already shows an incorrect ordering. Or are you saying that the ordering of the source code lines is different from your “input”, i.e. that the code is automatically generated and does not give you the correct sequence? Then the bug is in the code generator, i.e. you need to check the data source used by it. A manual change of the ordering does not sound like a good idea in an environment with generated code.

---

<div class="post-metadata">

**Author:** ![manishdodiya](https://avatars.discourse-cdn.com/v4/letter/m/41988e/32.png) [@manishdodiya](https://forum.fixtrading.org/u/manishdodiya)\
**Post date:** [January 31, 2020, 9:24am UTC](https://forum.fixtrading.org/t/how-we-can-change-tags-sequence-when-we-send-request-to-pse/14889/5 "2020-01-31T09:24:08Z")

</div>

quickfix.fix50sp1.NewOrderSingle newOrderSingle = new quickfix.fix50sp1.NewOrderSingle(new ClOrdID(order.getID()),  
sideToFIXSide(order.getSide()), new TransactTime(), typeToFIXType(order.getType()));  
newOrderSingle.set(new OrderQty(order.getQuantity()));  
newOrderSingle.set(new Symbol(order.getSymbol()));  
newOrderSingle.set(new Price(order.getSharePrice()));  
newOrderSingle.set(new Account(“13501100”));  
newOrderSingle.setField(new NoPartyIDs(1));  
newOrderSingle.setField(new PartyIDSource(‘C’));  
newOrderSingle.setField(new PartyRole(12));  
newOrderSingle.setField(new PartyID(“13501100”));  
newOrderSingle.setField(new TimeInForce(‘0’));

My Question is that when i have change any tag sequence, i have always got same sequence of tag in request. Screenshot is just example for giving understanding.

---

<div class="post-metadata">

**Author:** ![hanno.klein](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.fixtrading.org/hanno.klein/32/38_2.png) [@hanno.klein](https://forum.fixtrading.org/u/hanno.klein)\
**Post date:** [January 31, 2020, 9:36am UTC](https://forum.fixtrading.org/t/how-we-can-change-tags-sequence-when-we-send-request-to-pse/14889/6 "2020-01-31T09:36:12Z")

</div>

I am afraid I do not understand your question. You do not provide any context on your code snippet, e.g. is it generated or manual?, what is the tool generating it?,…

> [@manishdodiya](#):
>
> newOrderSingle.setField(new NoPartyIDs(1));  
> newOrderSingle.setField(new PartyIDSource(‘C’));  
> newOrderSingle.setField(new PartyRole(12));  
> newOrderSingle.setField(new PartyID(“13501100”));

If this is manually created, change it to

> newOrderSingle.setField(new NoPartyIDs(1));  
> newOrderSingle.setField(new PartyID(“13501100”));  
> newOrderSingle.setField(new PartyIDSource(‘C’));  
> newOrderSingle.setField(new PartyRole(12));

If it is automatically created by a code generator then you have to debug the code generator.

This forum is not really intended to solve any specific software or tool problems.
