当我尝试解析我的修复消息时,它无法说“找不到字段134”。但是当我在调试器中看到消息时,标签134就存在了。我检查了我的数据字典,它似乎也很好。
以下是我的代码。
var QuoteGroup =
new QuickFix.FIX44.MassQuote.NoQuoteSetsGroup();
msg.GetGroup(1, QuoteGroup);
//bid group
bidQty = Int32.Parse(QuoteGroup.GetString(134));
string offerQty1 = QuoteGroup.GetField(135);
string bidPriceStr = QuoteGroup.GetField(tag: 188);
float.TryParse(bidPriceStr, out bidPrice);
修复讯息: 20170224-20:55:27.640:8 = FIX.4.4 | 9 = 132 | 35 = i | 34 = 2 | 49 = XCD12 | 52 = 20170224-20:55:30.274 | 56 = Q051 | 117 = 1 | 296 = 1 | 302 = AVG | 295 = 1 | 299 = 0 | 134 = 2000000 | 135 = 2000000 | 188 = 1.24556 | 190 = 1.24561 | 10 = 027 |
以下是DD:
<message name="MassQuote" msgtype="i" msgcat="app">
<field name="QuoteReqID" required="N" />
<field name="QuoteID" required="N" />
<field name="QuoteType" required="N" />
<field name="QuoteResponseLevel" required="N" />
<component name="Parties" required="N" />
<field name="Account" required="N" />
<field name="AcctIDSource" required="N" />
<field name="AccountType" required="N" />
<field name="DefBidSize" required="N" />
<field name="DefOfferSize" required="N" />
<group name="NoQuoteSets" required="Y">
<field name="QuoteSetID" required="Y" />
<component name="UnderlyingInstrument" required="N" />
<field name="QuoteSetValidUntilTime" required="N" />
<field name="TotNoQuoteEntries" required="Y" />
<field name="LastFragment" required="N" />
<group name="NoQuoteEntries" required="Y">
<field name="QuoteEntryID" required="Y" />
<component name="Instrument" required="N" />
<group name="NoLegs" required="N">
<component name="InstrumentLeg" required="N" />
</group>
<field name="BidPx" required="N" />
<field name="OfferPx" required="N" />
<field name="BidSize" required="N" />
<field name="OfferSize" required="N" />
<field name="ValidUntilTime" required="N" />
<field name="BidSpotRate" required="N" />
<field name="OfferSpotRate" required="N" />
<field name="BidForwardPoints" required="N" />
<field name="OfferForwardPoints" required="N" />
<field name="MidPx" required="N" />
<field name="BidYield" required="N" />
<field name="MidYield" required="N" />
<field name="OfferYield" required="N" />
<field name="TransactTime" required="N" />
<field name="TradingSessionID" required="N" />
<field name="TradingSessionSubID" required="N" />
<field name="SettlDate" required="N" />
<field name="OrdType" required="N" />
<field name="SettlDate2" required="N" />
<field name="OrderQty2" required="N" />
<field name="BidForwardPoints2" required="N" />
<field name="OfferForwardPoints2" required="N" />
<field name="Currency" required="N" />
</group>
</group>
如果您需要更多详细信息,请与我们联系。
答案 0 :(得分:2)
您尝试从QuoteSet组中提取134,而不是嵌套在其中的QuoteEntry组。
您的消息,根据群组缩进:
296=1 NoQuoteSets
302=AVG
295=1 NoQuoteEntries
299=0
134=2000000
135=2000000
188=1.24556
190=1.24561
您的代码应该是这样的:
var QuoteGroup =
new QuickFix.FIX44.MassQuote.NoQuoteSetsGroup();
msg.GetGroup(1, QuoteGroup);
var QuoteEntry =
new QuickFix.FIX44.MassQuote.NoQuoteSetsGroup.NoQuoteEntriesGroup();
QuoteEntry.GetGroup(1, QuoteEntry);
bidQty = Int32.Parse(QuoteEntry.GetString(134));