Click here to Skip to main content
15,893,622 members
Articles / Programming Languages / Python2.7
Tip/Trick

Python Script to Prettify FIX Protocol Message Logs

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
28 Jan 2017CPOL 14.3K   240   1  
Python Script to fill FIX Protocol Message Logs with information

The Financial Information eXchange (FIX) protocol is an electronic communications protocol initiated in 1992 for international real-time exchange of information related to the securities transactions and markets. The message fields are delimited using the ASCII 01 <start of header> character. They are composed of a header, a body, and a trailer. Example of a FIX message: (Pipe character is used to represent SOH character.)

8=FIX.4.2|9=178|35=8|<snipped>

The key in the key/value pair (separated by =) is represented by a number which can be decoded using dictionary XML for easier reading. This Python 2.7 script can replace the numeric key with the actual field name and also replace the numeric enum value with actual enum description. It is tested with FIX Protocol 5.0 SP2. The script requires at least 3 parameters.

python prettify_fix_log.py [-h][-e] <src log file> <output prettified log file> 
<path to FIX50SP2.xml> <path to FIXT11.xml>
Option -h: display usage
Option -e: convert enum to description

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Singapore Singapore
Shao Voon is from Singapore. His interest lies primarily in computer graphics, software optimization, concurrency, security, and Agile methodologies.

In recent years, he shifted focus to software safety research. His hobby is writing a free C++ DirectX photo slideshow application which can be viewed here.

Comments and Discussions

 
-- There are no messages in this forum --