FIX repeating groups to reuse same tags

TL;DR

It is not allowed in the tag-value encoding.
(but in FIXML it is)

Some explanations

My initial misunderstanding came from this statement in the FIX tag-value specification: see here, search for “Field presence”

A tag (field) must appear at most once in a message, except when the tag appears within a repeating group.

But as I learned this refers to the wire format of the message, not the definition of the message.

Whereas the FIX5.0SP2 spec Volume 1 refers to the definition of the message and states:

A tag number (field) should only appear in a message once. If it appears more than once in the message it should be considered an error with the specification document.

In the meantime I even found it mentioned in FIXimate when looking at the NestedParties component (emphasis mine): (link to NestedParties component in FIXimate)

The NestedParties component block is identical to the Parties Block. It is used in other component blocks and repeating groups when nesting will take place resulting in multiple occurrences of the Parties block within a single FIX message.. Use of NestedParties under these conditions avoids multiple references to the Parties block within the same message which is not allowed in FIX tag/value syntax.

BTW, there are also components NestedParties2, NestedParties3, NestedParties4 to work around this.

Information from FIX Trading Community Forum

The thread can be accessed here, but as far as I know you can only access it if you are a FIX TC member: FIX TC forum

The FIX expert Hanno Klein gave the following information:

The quote from the refactored online spec refers to the wire format of any instance of a message encoded in tagvalue syntax. It means that inside the wire format of a single repeating group a tag (field) may appear more than once.

FIXML does not have this restriction:

The restriction is actually limited to the tagvalue encoding. For example, the parties component is “Pty” for all instances in FIXML, the XML syntax/encoding of FIX. This is due to the fact that the XML syntax has an unambiguous structure with a distinct path to every occurrence of a component or field. The XML names only need to be unique within the same element.

Tag-value does:

For tagvalue, a parser needs to know when a repeating group starts and ends. The NoXXX field marks the starting point and a field that is not part of the group marks the ending point. There are no explicit delimiters for repeating groups in tagvalue and components (non-repeating) are not visible in the wire format at all. Technically, you are probably right that a Price tag could exist in two distinct repeating groups without causing a parser issue but I do not see the benefit to allow this exception to the rule. You cannot allow it for two adjacent levels, e.g. root + nesting level 1 or nesting level x + nesting level y.


This part from original answer still applies

On another note, when defining your own repeating groups please use the notation NoXXX for repeating groups since that is the official recommendation. see here, search for “NumInGroup field”

It is recommended that NumInGroup fields be named NoXXX, e.g. NoContraBrokers(382).

However, following your example with 44/Price you would normally see 566/LegPrice used as the price for an individual leg since the two are used differently. The former is the price used for the execution of an order, the latter is used when defining a leg of a strategy.

So in short, when defining your message structure and repeating groups you should really think about if the meaning of the tag is the same for all occurrences of the tag in the message and if it really makes sense to use the very same tag in the body and in repeating groups. Clarity should be first priority.


incorrect (strike through) part of original answer

At first I thought that this could not be allowed but mainly because I have never seen it appear somewhere in a real message. But actually I could not find a reason why it should not be allowed. The specification only says: see here, search for “Field presence”

A tag (field) must appear at most once in a message, except when the tag appears within a repeating group.

A tag (field) must appear at most once per repeating group instance.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top