Search code examples
fix-protocol

Is it legal to repeat the same value in a MULTIPLECHARVALUE or MULTIPLESTRINGVALUE field?


Let's assume a FIX field is of type MULTIPLECHARVALUE or MULTIPLESTRINGVALUE, and the enumerated values defined for the field are A, B, C and D. I know that "A C D" is a legal value for this field, but is it legal for a value to be repeated in the field? For example, is "A C C D" legal? If so, what are its semantics?

I can think of three possibilities:

  1. "A C C D" is an invalid value because C is repeated.
  2. "A C C D" is valid and semantically the same as "A C D". In other words, set semantics are intended.
  3. "A C C D" is valid and has multiset/bag semantics.

Unfortunately, I cannot find any clear definition of the intended semantics of MULTIPLECHARVALUE and MULTIPLESTRINGVALUE in FIX specification documents.


Solution

  • The FIX50SP2 spec does not answer your question, so I can only conclude that any of the three interpretations could be considered valid.

    Like so may questions with FIX, the true answer is dependent upon the counterparty you are communicating with.

    So my answer is:

    1. if you are client app, ask your counterparty what they want (or check their docs).
    2. if you are the server app, you get to decide. Your docs should tell your clients how to act.

    If it helps, the QuickFIX/n engine treats MultipleCharValue/MultipleStringValue fields as strings, and leaves it to the application code to parse out the individual values. Thus, it's easy for a developer to support any of the interpretations, or even different interpretations for different fields. (I suspect the other QuickFIX language implementations are the same.)