Question

When processing a QuickFix44.NewOrderMultileg message in C#, how do you extract the details of the legs?

The only documentation I've found so far seems to apply only to market data and/or be wildly out of date: http://www.quickfixengine.org/quickfix/doc/html/csharp/repeating_groups_2.html

Was it helpful?

Solution

Same as you have done in the application, but you have to go a little deeper.

NewOrderMultileg -> InstrumentLeg/LegSipulations and other groups and fields.

Get the count of legs present in the message by reading NoLegs. Then iterate over the message reading the groups one by one.

The components in the message may be in a group or single. Whenever you find the suffix Grp expect multiple groups. Refer here for clarification.

Do not write the same piece of code multiple times, make a loop. You don't know how many groups are there in the message.

for (int i = 1; i <= groupCount; ++i)
{
    message.getGroup(i, group);
    group.get(MDEntryType);
    group.get(MDEntryPx);
    group.get(MDEntrySize);
    group.get(orderID);
    /* Do other stuff */
}

For components in the message, one for each leg, read the component in that loop as well.

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