开发者

How do you read the legs of a multileg order using QuickFix in C#?

When processing a QuickFix44.NewOrderMultileg开发者_Go百科 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜