user4157482
user4157482

Reputation: 849

How to handle recursion in FIX?

Imagine a situation where you need to have recursive data structures, like trees, represented in a FIX message. How would you do that?

I could represent a data structure in JSON like this:

{
  {
    "name": "1"
  },
  {
    "name": "3",
    "chains": [
      [
        {
          "name": "a"
        },
        {
          "name": "c",
          "chains": [
            {
              "name": "x"
            },
          ]
        }
      ],
      [
        {
          "name": "A"
        },
      ]
    ]
  }
}

How could I represent this in FIX?


I'm going to propose a solution here.

Standard FIX tag numbers are ignored.

Tags:

Components:

Lines starting with # are comment and are not part of the actual message. New lines are tag delimiters.

# start of level 0
3=2
1=1
1=3
start of level 1
4=2
3=2
1=a
1=c
# start of level 2
4=1
3=1
1=x
# end of level 2
3=1
1=A
# end of level 1
# end of level 0

Please comment if this is valid FIX or not and whether there is a better way to express this in FIX.

Upvotes: 0

Views: 71

Answers (1)

Grant Birchmeier
Grant Birchmeier

Reputation: 18484

There is no good reason to have a recursive segment in a FIX message. Why would any financial info transmission need to go infinitely deep?

You can't find any information about it because there aren't any parties in the traditional FIX userbase who would want that.

I suppose you could customize your FIX data dictionary to make a repeating group contain itself. I suspect that such a DD would crash the code generators of at least one (if not all) of the QuickFIX ports, as they probably aren't checking for such insanity (and thus will keep creating recursive structures in your memory until they blow it).

Upvotes: 2

Related Questions