Contra Element

Imported from previous forum

The “Contra” element / component in FIX has no mandatory fields (count tag = 382). When used in FIXML if no tags are available for the component should the whole “Contra” element be excluded from the FIXML message?

Taking this further… would the sample below be valid… and how could/should it be converted to FIX tag-value… there are 3 elements for “Contra” but in tag-value a count of 3 would be invalid as one of the repeating group elements would be empty, which would be invalid…

<ns0:ExecRpt xmlns:ns0="http://www.fixprotocol.org/FIXML-5-0"
OrdID="1"
ID=“110” ExecTyp=“F” Stat="2"
Side=“2” Px=“13000.0” AvgPx="0.0"
ExecID=“1” LastPx=“1” LastQty="1"
LeavesQty=“0” CumQty="1"
TrdDt="2010-09-23"
TxnTm="2010-09-23T22:01:54.754"
SettlTyp="4"
TradeId="1"
SettlDt=“2010-09-28”>
<ns0:Hdr SID=“SID” TID=“TID” SeqNum="80"
PosDup=“N” PosRsnd=“N” Snt=“2010-09-23T22:01:54.76”/>
<ns0:Pty ID=“1” Src=“D” R=“1”/>
<ns0:Pty ID=“2” Src=“D” R=“2”/>
ns0:Contra/
<ns0:Contra 375=”SOMEVALUE”/>
<ns0:Contra 375=”SOMEVALUEOTHERVALUE”/>
<ns0:Instrmt Sym=“A” Exch=“A”/>
<ns0:OrdQty Qty=“1”/>
</ns0:ExecRpt>

Any help appreciated

Thanks

Clive

Hi Clive,

I do not understand the semantic that the sender is trying to convey in this case. Is it “there are 3 contra brokers, one of which I have no further information on or I have information but I cannot disclose it”?

If I understand the issue correctly then it is not about an empty repeating group but about an empty INSTANCE of a repeating group. In the tag=value syntax it is not possible to convey an empty instance, i.e. NoXXX and the number of field sets must be identical. Each of the field sets starts with the first field of the group which is conditionally required. The FIXML syntax does not have NoXXX fields, i.e. the cardinality is implicit and each instance has a separate element enclosed in “<” and "". This makes possible what you show below.

My view is that NoXXX must not be overloaded with multiple semantics. The only semantic it has is of technical nature and in the context of tag=value syntax. For example, in case of the contra brokers, its sole purpose is to convey the number of contra brokers for which detailed information is about to follow. It does NOT convey the number of actual contra brokers. A separate (new) field, e.g. TotNumContraBrokers would be needed to convey that there were 3 brokers, followed by a repeating group conveying data about two of them. Then you have an explicit field in FIXML and no mapping problem.

A construct such as ns0:Contra/ must not be allowed as it cannot be mapped to tag=value which is the basis for everything in FIX. A workaround is to send 375 with a dummy value or an empty string, i.e. <ns0:Contra 375=”[N/A]”/> or <ns0:Contra 375=””/>.

Empty repeating groups can be conveyed in tag=value by omitting the group. This is only available for optional repeating groups, e.g. MDFullGrp does not allow its omittance and a new MDEntryType=J=Empty Book was added for that purpose. This is worth a discussion but it is a different issue.

To summarize, issues are:
a) empty instance of a repeating group
b) empty repeating group

My view is that a) must not be allowed explicitly as it can only be done in FIXML (<GroupName>) and that b) must not be allowed explicitly as it can only be done in tag=value (NoXXX=0). I am only aware of a discussion on b) in the past but not on a).

Market data is a special case for b) because book data is not the only information that can be part of the repeating group, i.e. you can send trades as well as an empty book. Absence of the entire group thus is not identical to MDEntryType=J because absence also means there are no trades, opening prices, highs, lows,… available.

Regards,
Hanno.

The “Contra” element / component in FIX has no mandatory fields (count tag = 382). When used in FIXML if no tags are available for the component should the whole “Contra” element be excluded from the FIXML message?

Taking this further… would the sample below be valid… and how could/should it be converted to FIX tag-value… there are 3 elements for “Contra” but in tag-value a count of 3 would be invalid as one of the repeating group elements would be empty, which would be invalid…

<ns0:ExecRpt xmlns:ns0=“http://www.fixprotocol.org/FIXML-5-0
OrdID=“1”
ID=“110” ExecTyp=“F” Stat=“2”
Side=“2” Px=“13000.0” AvgPx=“0.0”
ExecID=“1” LastPx=“1” LastQty=“1”
LeavesQty=“0” CumQty=“1”
TrdDt=“2010-09-23”
TxnTm=“2010-09-23T22:01:54.754”
SettlTyp=“4”
TradeId=“1”
SettlDt=“2010-09-28”>
<ns0:Hdr SID=“SID” TID=“TID” SeqNum=“80”
PosDup=“N” PosRsnd=“N” Snt=“2010-09-23T22:01:54.76”/>
<ns0:Pty ID=“1” Src=“D” R=“1”/>
<ns0:Pty ID=“2” Src=“D” R=“2”/>
ns0:Contra/
<ns0:Contra 375=”SOMEVALUE”/>
<ns0:Contra 375=”SOMEVALUEOTHERVALUE”/>
<ns0:Instrmt Sym=“A” Exch=“A”/>
<ns0:OrdQty Qty=“1”/>
</ns0:ExecRpt>

Any help appreciated

Thanks

Clive

Clive,

I agree with what Hanno said regarding use of the NoXXX fields and empty instances of repeating groups. However I’d like to correct the examples, as the following isn’t valid FIXML:

<ns0:Contra/>
<ns0:Contra 375=”SOMEVALUE”/>
<ns0:Contra 375=”SOMEVALUEOTHERVALUE”/>

Tag numbers don’t appear as attributes; FIXML abbreviations do. Eliminating the empty group, we’d have:

Addiontally, I’m not sure I understand what you are trying to convey at a business level. While not technically required by FIX, I’d think if you are specifying more than one contra broker, you’d need to send CntraTrdQty for each. E.g. for my 7 contract trade, broker SOMEVALUE traded 5 with me, and broker SOMEVALUEOTHERVALUE traded 2 with me. But what makes this more confusing is that the example message shows LastQty=“1”. How can an execution for 1 contract or share be traded against 3 contra brokers, 2 specified, one not?

Hi Ryan and Hanno

Thanks for the feedback… my example incorrectly used the Tag number rather than Attribute name (well spotted).

The actual details of the message content are not important, it is the empty element issue that i was curious about…

The general consensus seems to be inline with Hanno’s comment…

“A construct such as ns0:Contra/ must not be allowed as it cannot be mapped to tag=value which is the basis for everything in FIX”

Our counter-party providing the XML messages is going to change their implementation so they do not use empty elements.

Thanks

Clive

Clive,

I agree with what Hanno said regarding use of the NoXXX fields and empty instances of repeating groups. However I’d like to correct the examples, as the following isn’t valid FIXML:

<ns0:Contra/>
<ns0:Contra 375=”SOMEVALUE”/>
<ns0:Contra 375=”SOMEVALUEOTHERVALUE”/>

Tag numbers don’t appear as attributes; FIXML abbreviations do. Eliminating the empty group, we’d have:

Addiontally, I’m not sure I understand what you are trying to convey at a business level. While not technically required by FIX, I’d think if you are specifying more than one contra broker, you’d need to send CntraTrdQty for each. E.g. for my 7 contract trade, broker SOMEVALUE traded 5 with me, and broker SOMEVALUEOTHERVALUE traded 2 with me. But what makes this more confusing is that the example message shows LastQty=“1”. How can an execution for 1 contract or share be traded against 3 contra brokers, 2 specified, one not?