Thread: [Quickfix-developers] Adding Custom Message to Fix42.xml and handling in application
Brought to you by:
orenmnero
From: Nikhil C. <nik...@gm...> - 2009-02-27 09:30:00
|
Hi, I have a specific requirement to add a custom message and handle the response for the same. I have done following so far - In the Fix42.xml I have added following - In the <messages> section,: <!-- ============================== --> <!-- Begin Custom Messages --> <message name="MyCustomPositionReport" msgtype="MCM59" msgcat="app"> <field name="MyCustomPositionRequestId" required="Y" /> <group name="MyCustomPositionGroup" required="N"> <field name="Account" required="Y" /> <field name="SecurityID" required="N" /> <field name="WorkingLong" required="Y"/> <field name="WorkingShort" required="Y"/> <field name="OpenPosition" required="Y"/> <field name="AvgPx" required="N"/> <field name="SecurityExchange" required="N"/> <field name="Symbol" require="N"/> <field name="MaturityMonthYear" required="N"/> </group> </message> <message name="MyCustomPositionRequest" msgtype="MCM60" msgcat="app"> <field name="MyCustomPositionRequestId" required="Y" /> <group name="MyCustomAccountGroup" required="Y"> <field name="Account" required="Y" /> </group> </message> <!-- End Custom Messages --> <!-- ============================ --> and in the fields section I have added following - <!-- ============================== --> <!-- Begin Custom Messages Fields --> <field number="1102400" name="MyCustomPositionGroup" type="INT" /> <field number="1102500" name="MyCustomAccountGroup" type="INT" /> <field number="1102600" name="MyCustomPositionRequestId" type="INT"/> <field number="1101700" name="OpenPosition" type= "INT"/> <field number="1101800" name="WorkingLong" type="INT"/> <field number="1101900" name="WorkingShort" type="INT"/> <!-- End Custom Messages Fields --> <!-- ============================ --> I am using C# (2.0) for development and after making the changes in the xml file, I have rebuild the quickfix solution. When I am using the dll in the project, I am not getting the class for MyCustomPositionReport and request. Is there anything else I have to do so that I will get this working? Thanks in advance, Regards Niks. |
From: Brian E. <azz...@ya...> - 2009-02-27 15:53:37
|
This was supposed to be added to the QF documentation, but never was. I put together a tutorial on custom messages a few years back, and as QF hasn't really changed much since then, it should still work fine. http://www.nabble.com/Custom-Messages-Classes-Tutorial-td13495584.html - Brian Erst ________________________________ ________________________________ From: Nikhil Chitnis <nik...@gm...> To: QuickFix Developers <qui...@li...> Sent: Friday, February 27, 2009 3:29:53 AM Subject: [Quickfix-developers] Adding Custom Message to Fix42.xml and handling in application QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html Hi, I have a specific requirement to add a custom message and handle the response for the same. I have done following so far - In the Fix42.xml I have added following - In the <messages> section,: <!-- ============================== --> <!-- Begin Custom Messages --> <message name="MyCustomPositionReport" msgtype="MCM59" msgcat="app"> <field name="MyCustomPositionRequestId" required="Y" /> <group name="MyCustomPositionGroup" required="N"> <field name="Account" required="Y" /> <field name="SecurityID" required="N" /> <field name="WorkingLong" required="Y"/> <field name="WorkingShort" required="Y"/> <field name="OpenPosition" required="Y"/> <field name="AvgPx" required="N"/> <field name="SecurityExchange" required="N"/> <field name="Symbol" require="N"/> <field name="MaturityMonthYear" required="N"/> </group> </message> <message name="MyCustomPositionRequest" msgtype="MCM60" msgcat="app"> <field name="MyCustomPositionRequestId" required="Y" /> <group name="MyCustomAccountGroup" required="Y"> <field name="Account" required="Y" /> </group> </message> <!-- End Custom Messages --> <!-- ============================ --> and in the fields section I have added following - <!-- ============================== --> <!-- Begin Custom Messages Fields --> <field number="1102400" name="MyCustomPositionGroup" type="INT" /> <field number="1102500" name="MyCustomAccountGroup" type="INT" /> <field number="1102600" name="MyCustomPositionRequestId" type="INT"/> <field number="1101700" name="OpenPosition" type= "INT"/> <field number="1101800" name="WorkingLong" type="INT"/> <field number="1101900" name="WorkingShort" type="INT"/> <!-- End Custom Messages Fields --> <!-- ============================ --> I am using C# (2.0) for development and after making the changes in the xml file, I have rebuild the quickfix solution. When I am using the dll in the project, I am not getting the class for MyCustomPositionReport and request. Is there anything else I have to do so that I will get this working? Thanks in advance, Regards Niks. |
From: Brian E. <azz...@ya...> - 2009-03-02 16:11:55
|
That's curious, as the FIX 4.4 standard (as well as the FIX44.xml file shipped with QF 1.12.4) defines "ClOrdId" as NOT required when part of a NoSides group in the TradeCaptureReport. Did you, perhaps, modify the wrong message? NoSides groups in other messages (NewOrderCross, CrossOrderCancelReplaceRequest) DO require ClOrdId, but that's NOT the case in TradeCaptureReport. None of this should require a recompile - these are run-time checks. Has anyone else in the QF community had this problem? - Brian Erst Thynk Software, Inc. ________________________________ From: Julian <jul...@pr...> To: Brian Erst <azz...@ya...> Sent: Monday, March 2, 2009 8:44:09 AM Subject: RE: [Quickfix-developers] Adding Custom Message Hi Brian, We are having some trouble on the QF validation of a message. We thought there was an unseen error on our procedure, but when I read this on your tutorial I don’t think so: “Second, QuickFIX uses the "required" attribute of tags when generating constructors for message objects. If the required attribute is set to "Y", that field will become part of a constructor. Don't be tempted to set the required attribute to "Y" on the existing fields of an existing message. Even if your counterparty requires the RawData field on a Logon message, this is not the place to force that validation. If you do it here, much of the QuickFIX build will fail, as many of the acceptance tests will not be able to construct message objects that have suddenly gained a required parameter. Once you've built your custom version of QuickFIX, make a copy of your XML files to your deployment environment and modify those copies to make fields required at run-time. Perhaps a future version of QuickFIX could add another attribute that could distinguish between "required for constructors" and "required for run-time validation".” English, as you might see, is my second language; so it’s not much clear to me what you say. Here is our inconvenient: The exchange (acceptor) change a message definition, setting a required field as “not required”, the message is a TradeCaptureReport (35=”AE”) and the field is ClOrdID(tag 11) in the “NoSide”(tag 552). As we’ve done before, we edit the FIX4.4 xml to make it valid: <field name="ClOrdID" required="N" /> In the corresponding message. To our surprise, the error persist (QF reject the message saying “Missing required message field (11)”. Can this have anything to do with what you said? What should we do? Rebuild QF libraries? But we don’t use any Dictionary while building them, the dictionary is added the settings of a new session… Thanks, Julián Mendiola | PSF Developer Leader http://www.prosoftwarefactory.com.ar From:Brian Erst [mailto:azz...@ya...] Sent: Friday, February 27, 2009 1:54 PM To: QuickFix Developers Subject: Re: [Quickfix-developers] Adding Custom Message to Fix42.xml and handling in application This was supposed to be added to the QF documentation, but never was. I put together a tutorial on custom messages a few years back, and as QF hasn't really changed much since then, it should still work fine. http://www.nabble.com/Custom-Messages-Classes-Tutorial-td13495584.html - Brian Erst ________________________________ ________________________________ From:Nikhil Chitnis <nik...@gm...> To: QuickFix Developers <qui...@li...> Sent: Friday, February 27, 2009 3:29:53 AM Subject: [Quickfix-developers] Adding Custom Message to Fix42.xml and handling in application QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html Hi, I have a specific requirement to add a custom message and handle the response for the same. I have done following so far - In the Fix42.xml I have added following - In the <messages> section,: <!-- ============================== --> <!-- Begin Custom Messages --> <message name="MyCustomPositionReport" msgtype="MCM59" msgcat="app"> <field name="MyCustomPositionRequestId" required="Y" /> <group name="MyCustomPositionGroup" required="N"> <field name="Account" required="Y" /> <field name="SecurityID" required="N" /> <field name="WorkingLong" required="Y"/> <field name="WorkingShort" required="Y"/> <field name="OpenPosition" required="Y"/> <field name="AvgPx" required="N"/> <field name="SecurityExchange" required="N"/> <field name="Symbol" require="N"/> <field name="MaturityMonthYear" required="N"/> </group> </message> <message name="MyCustomPositionRequest" msgtype="MCM60" msgcat="app"> <field name="MyCustomPositionRequestId" required="Y" /> <group name="MyCustomAccountGroup" required="Y"> <field name="Account" required="Y" /> </group> </message> <!-- End Custom Messages --> <!-- ============================ --> and in the fields section I have added following - <!-- ============================== --> <!-- Begin Custom Messages Fields --> <field number="1102400" name="MyCustomPositionGroup" type="INT" /> <field number="1102500" name="MyCustomAccountGroup" type="INT" /> <field number="1102600" name="MyCustomPositionRequestId" type="INT"/> <field number="1101700" name="OpenPosition" type= "INT"/> <field number="1101800" name="WorkingLong" type="INT"/> <field number="1101900" name="WorkingShort" type="INT"/> <!-- End Custom Messages Fields --> <!-- ============================ --> I am using C# (2.0) for development and after making the changes in the xml file, I have rebuild the quickfix solution. When I am using the dll in the project, I am not getting the class for MyCustomPositionReport and request. Is there anything else I have to do so that I will get this working? Thanks in advance, Regards Niks. No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.0.237 / Virus Database: 270.11.3/1973 - Release Date: 02/27/09 07:05:00 |