Question

I have a FIX log file. I'm iterating on the lines, putting each string into

Message m = new Message(str, false)

Because for some reason, validation fails on the file (even the first line). Now, I see that it's a 35=X type, and 268=4 (i.e. NoMDEntries=4, so I should have 4 groups in the message)

BUT, in the debug display I am not seeing any groups. m.base._groups has a count of 0.

The string in question is:

1128=9 | 9=363 | 35=X | 49=CME | 34=3151 | 52=20121216223556363 | 75=20121217 | 268=4 | 279=0 | 22=8 | 48=43585 | 83=902 | 107=6EH3 | 269=4 | 270=13186 | 273=223556000 | 286=5 | 279=0 | 22=8 | 48=43585 | 83=903 | 107=6EH3 | 269=E | 270=13186 | 271=9 | 273=223556000 | 279=0 | 22=8 | 48=43585 | 83=904 | 107=6EH3 | 269=F | 270=13185 | 273=223556000 | 279=1 | 22=8 | 48=43585 | 83=905 | 107=6EH3 | 269=0 | 270=13186 | 271=122 | 273=223556000 | 336=0 | 346=10 | 1023=1 | 10=179 | 

Another thing is how do I read the groups? Instinctively, I want to do something like

for (int i = 1; i <= noMDEntries; i++) {
    Group g = m.GetGroup(i);
    int action = Int32.Parse(g.GetField(279));
    ....
}

But that's not how it works and I haven't found documentation with better explanations.

Thanks for the help, Yonatan.

Was it helpful?

Solution

From your code snippets, I think you're using QuickFIX/n, the native C# implementation, so I will answer accordingly.

1) Your message construction is failing because you didn't provide a DataDictionary.

Use Message::FromString instead:

Message m = new Message();
m.FromString(msg_str, false, data_dic, data_dic, someMsgFactory);

Even better, use MarketDataIncrementalRefresh::FromString to get the right return type.

You can see some uses of this function here:
https://github.com/connamara/quickfixn/blob/master/UnitTests/MessageTests.cs

2) To read groups... well, QF/n has a doc page on that, which I think explains it pretty well.
http://quickfixn.org/tutorial/repeating-groups

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top