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

Grant Birchmeier gbirchmeier at connamara.com
Tue Feb 9 12:10:20 PST 2016


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> 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
>
>
>
> _______________________________________________
> Quickfixn mailing list
> 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/cb6d816a/attachment-0002.htm>


More information about the Quickfixn mailing list