{{Quickfixn}} Question: Creating/populating a FIX message from a string - tag order problem

Philip Clem pclem at 4thstory.com
Tue Feb 9 14:43:42 PST 2016


Grant,

 

Thanks for the response.

I changed the code to follow your suggestion, so the call would use the MarketDataRequest FromString():
I am still getting the resulting message with tags in numerical order when I use the wired in MarketDataRequest object

.var message = new QuickFix.FIX44.MarketDataRequest();
            QuickFix.IMessageFactory messageFactory = new QuickFix.DefaultMessageFactory();
            QuickFix.DataDictionary.DataDictionary dataDict = new QuickFix.DataDictionary.DataDictionary(@"M:\X4S_4.6\Config\FIXN\FIX44_ECV.xml");
             message.FromString(sb.ToString(), false, dataDict, dataDict, messageFactory);

Note that I am creating the message from a string that does not include the header, and then I am applying the header after this code snippet.
So what I am talking about in this code snippet is just setting the message from a string that has only the message body tags.

 

Any other ideas about I could do to end up with the correct tag order?

 

Thanks,

Philip Clem

 

From: Quickfixn [mailto:quickfixn-bounces at lists.quickfixn.com] On Behalf Of Grant Birchmeier
Sent: Tuesday, February 9, 2016 12:10 PM
To: Mailing list for QuickFIX/n <quickfixn at lists.quickfixn.com>
Subject: Re: {{Quickfixn}} Question: Creating/populating a FIX message from a string - tag order problem

 

I see the problem.  You're calling Message's FromString method, instead of MarketDataRequest's FromString.

 

Change your first line to this:

QuickFix.FIX44.MarketDataRequest​ message =

​  ​

new QuickFix.FIX44.MarketDataRequest();

 

(Alternately you could, and probably should, just use var instead.)

 

That will cause message to call the right version of FromString().

 

 

On Tue, Feb 9, 2016 at 10:51 AM, Philip Clem <pclem at 4thstory.com <mailto:pclem at 4thstory.com> > wrote:

Using the “message.FromString()” API, and entering a message string with tags in the proper order, I end up with a message that has tags in numerical order.

 

String messageText = “262=1263=1264=1265=1266=Y267=4269=0269=1269=2269=B146=155=TUR.2032.D03875460=6167=CORP”;

 

QuickFix.Message message = new QuickFix.FIX44.MarketDataRequest();

                QuickFix.IMessageFactory messageFactory = new QuickFix.DefaultMessageFactory();

                QuickFix.DataDictionary.DataDictionary dataDict = new QuickFix.DataDictionary.DataDictionary(@"M:\X4S_4.6\Config\FIXN\FIX44_ECV.xml");

                message.FromString(sb.ToString(), false, dataDict, dataDict, messageFactory);

 

Resulting message string:

9=12055=TUR.2032.D03875146=1167=CORP262=1263=1264=1265=1266=Y267=4269=0460=610=012

 

That, of course, means the message is incorrectly formed for a message like a MarketDataRequest that has grouped sections like: 146=1 55= TUR.2032.D03875.

Also I get the same incorrect numerical tag order if I use the API:

                

message.SetField(new QuickFix.Fields.StringField(pair.Tag, tagValue));

 

Is there a way to prevent message tags from going into the message in numerical order?

 

Philip H. Clem

pclem at 4thstory.com <mailto:pclem at 4thstory.com> 

 


_______________________________________________
Quickfixn mailing list
Quickfixn at lists.quickfixn.com <mailto:Quickfixn at lists.quickfixn.com> 
http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com





 

-- 

Grant Birchmeier

Connamara Systems, LLC

Made-To-Measure Trading Solutions.

Exactly what you need. No more. No less.

http://connamara.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20160209/2eb7ac22/attachment-0002.htm>


More information about the Quickfixn mailing list