Hi there I am having issues with Quick Fix python. I need to add Tag 554 to my outbound Logon message to send messages in to the exchange as it is required but I am unsure how to go about this. All the online examples I find are C++ code and my attempts to translate those to Python are not successful.
If someone could advise how to send Logon messages out with a password tag it would be appreciated:
def toAdmin(self, sessionID, message):
message.getHeader().setField(554, "password")
Your code looks close to correct. You didn't actually say what happens when you run it, so I can't be 100% sure what you think is wrong with it.
But there is one improvement that is needed: You only want to set the password on Logon messages.
def toAdmin(self, sessionID, message):
if message.getHeader().getField(35) == "A":
message.getHeader().setField(554, "password")
(Forgive any Python syntax errors; it's not a language I know well.)
This is very similar to what you'd do in any other QF port. For instance, see the QuickFIX/n User FAQ for the C# way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With