Search code examples
pythonquickfixfix-protocol

Getting fields from quickfix message


I am using quickfix with python. Looking at the doc page here tells us how to get fields. Say a message = fix.message (with quickfix as fix) comes in from the counterparty. I can get the 35 (MsgType) field by calling

message.getHeader().getField(fix.MsgType())

which returns, for example, 35=X.

My question is: is there any method which just returns X? Or do I have to slice everything (like 35=X[3:], which returns X) and know the length of all the strings therefore?


Solution

  • The answer is to get the field by first calling message.getHeader().getField(fix.MsgType()) then get the value by calling fix.MsgType().getValue().