22

I am relatively new to FIX-Protocol.

The delimiter for a FIX-Protocol message sometimes show ^ and other times |. Wikipedia for FIX-Protocol says [SOH] ( <Start of Header> for hex 0x01 ) being the character.

Please explain the meaning of the same.

For example a FIX-Protocol message can be visually represented as

8=FIX.4.4^9=122^35=D^34=215^49=CLIENT12^52=20100225-19:41:57.316^56=B^1=Marcel^11=13346^21=1^40=2^44=5^54=1^59=0^60=20100225-19:39:52.020^10=072^

or

8=FIX.4.4|9=122|35=D|34=215|49=CLIENT12|52=20100225-19:41:57.316|56=B|1=Marcel|11=13346|21=1|40=2|44=5|54=1|59=0|60=20100225-19:39:52.020|10=072|

So what exactly is the difference in using a ^ over |

Are there other delimiters used as well. Its not clear why [SOH] (0x01) fits for ^ or |

It could have been numerical ONE.

Drew Dormann
  • 59,987
  • 13
  • 123
  • 180
Ashley
  • 629
  • 3
  • 6
  • 16

3 Answers3

19

The delimiter SOH = ASCII code 01 is a non-printable character. Looking at the binary representation of the message (e.g. in a hex editor view), you'll see the character as 0x01. To display the messages, it seems that some people use | and other use ^ which are rarely used characters and thus a good delimiter.

MP24
  • 3,110
  • 21
  • 23
  • 4
    So, this means, a real fix message on the wire/socket/network will not contain | or ^ character but only 0x01, however, once off the wire, 0x01 is replaced by one of the | or ^ characters. I may be off the target here, but really appreciate your help. – Ashley Aug 13 '14 at 20:58
  • Yes, see http://fixwiki.org/fixwiki/FPL:Tag_Value_Syntax for a description of the format. Looking into source code for quickfix, it also uses 0x01 as delimiter. – MP24 Aug 13 '14 at 21:16
  • 3
    One other point to add - I often see rax messages in logfiles. On Linux, the SOH will often be shown in the terminal as its C escape code, ^A, eg: 8=FIX.4.2^A9=207^A35=D^A43=N^A52=20140825-07:24:08^A122=20140825-07:24:08^A... . – Andy Lynch Sep 08 '14 at 15:38
6

using the | character is just for visual convenience, easier to read than ^A

cat your.file.fix | tr '\01' '|' | less

you can easily transform the above command as a custom shell script to open FIX sessions files

~/.bashrc

function fixlog {
  cat $* | tr '\01' '|' | less
}

then simply

fixlog your.file.fix
Julien
  • 1,765
  • 20
  • 26
1

FIX messages always have 0x01 between fields in the message, whether it is on the wire, in an OMS/EMS or in a log file. It is only when the message has to be displayed that the substitution is made (OK, some people may make their log files clean and so transcribe the character). It is never the case that a valid FIX message will have pipes or carets separating fields. It is also the case that a FIX message will never have anywhere than between fields. ( is a character which shouldn't appear in printed text - FIX messages are supposed to be readable - and it won't clash with that terminates a C string, so the whole message can be treated as a string, if you are so inclined.)

Mark Reece
  • 11
  • 1