4

When want to send a Quickfix message (Logon, for example) do I need to go and fill in every field manually, or will data from the Settings file get automatically added as necessary.

Currently, I can connect but not log into my broker's FIX server and I'm having trouble getting any idea of what I'm doing wrong.

user
  • 86,916
  • 18
  • 197
  • 190
gearhead
  • 787
  • 1
  • 6
  • 26

2 Answers2

2

QuickFix will connect and send a Logon automatically when you invoke start from your initiator. As for not being able to get through to your broker, ask them to confirm that they can see your Logon request. Also, make sure they don't require extra fields, like a password or a SubID.

chrisaycock
  • 36,470
  • 14
  • 88
  • 125
  • How can it log me in automatically when I haven't given it my password anywhere? I have list of the fields they need for a logon, but things like 'cheksum' I don't know how to calculate. I imagine that it is done automatically, but then I was wondering what else might be automatically included by the Quickfix code. – gearhead Nov 09 '12 at 19:12
  • 1
    @gearhead You don't calculate the CheckSum; that's up to QuickFIX. If you need to send a password with your Logon, you'll have to override `toAdmin` and fill-in the appropriate field on the message. – chrisaycock Nov 09 '12 at 19:20
  • See [the QF/J user FAQ](http://www.quickfixj.org/confluence/display/qfj/User+FAQ) for an example of how to set the password in a logon message. (That FAQ is for the Java version, but you should be able to figure out the C++ equivalent from there.) – Grant Birchmeier Nov 09 '12 at 21:03
  • Thanks @GrantBirchmeier, I think I understand WHAT I need to do now. When I do `sessionID.isHeaderField(554)` I see that the password field doesn't exist, but when I try to add it with `sessionID.setString(554, password)`, everything blows up saying that I am not using the `setField()` method correctly. (BTW, I'm using Python 2.7) – gearhead Nov 09 '12 at 21:27
  • 2
    @gearhead Don't add the password to the *session ID*; add it to the *message*. – chrisaycock Nov 09 '12 at 21:32
  • @gearhead - yes, like chrisaycock said. Don't mess with the sessionID! Password is a field in Logon's message body. – Grant Birchmeier Nov 09 '12 at 22:44
  • Agreed. The arguments in the `toAdmin()` method were reversed (..I have no idea why..)... so I got that straightened out, and it looks like I can properly get the password field into my outbound message... now onto fight other problems. I think I exceeded my broker's logon attempt limits during all this, so I need to chase that down! Thanks for all the help @chrisaycock and @grantbirchmeier! – gearhead Nov 09 '12 at 22:50
  • 1
    @gearhead If you're all set, plase mark the answer as accepted. And don't forget to upvote good content. Thanks! – Grant Birchmeier Nov 10 '12 at 20:50
1

QuickFIX fills in the fields from the QuickFIX settings / config file. So things like TargetCompID, SenderCompID, Host are all filled in automatically when QuickFIX handles the connection. see the config guide for more details of which fields can be filled in here. Though you can add fields to this file they will not be automatically filled in by the quickFIX engine. You will need to override the toAdmin method in order to add additional fields to the message.

When you override the toAdmin method you will need to check the message type. If the message object works the same as it does in Java you will need to get the message header and check the message type field in the message header, as it is not in the message body.

robthewolf
  • 7,343
  • 3
  • 29
  • 29