在Quickfix C ++中重复组消息

时间:2012-10-17 01:30:20

标签: quickfix

我们似乎无法使用QuickFix处理某些群组消息。

我正在尝试使用QuickFix(C ++)建立与ICE交换的连接。我创建了一个自定义数据字典来处理ICE的非标准消息。要处理的第一个消息是SecurityDefinition。该消息包含大约13000个条目,分为100个块。我附上了以下消息(为了清楚起见,添加了CR / LF的前两个条目)。

我的问题是在数据字典中,我将一个组定义为条目的一部分,其中包含它们在组中指定的所有字段。然而,在消息传递给破解者之前,该消息被拒绝为具有无效标记(tag = 305)。

消息2已拒绝:未为此消息类型定义标记:305

这个词典条目看起来是否正确?是否有关于如何处理群组消息的任何文档?

词典条目:

<message name='SecurityDefinition' msgcat='app' msgtype='d'>
    <field name='SecurityResponseID' required='Y' />
    <field name='SecurityResponseType' required='Y' />
    <field name='SecurityReqID' required='Y' />
    <field name='TotNoRelatedSym' required='N' />
    <field name='NoRpts' required='N' />
    <field name='ListSeqNo' required='N' />
    <group name='NoUnderlyings' required='N'>
        <field name='UnderlyingSymbol' required='N' />
        <field name='UnderlyingSecurityID' required='N' />
        <field name='UnderlyingSecurityIDSource' required='N' />
        <field name='UnderlyingCFICode' required='N' />
        <field name='UnderlyingSecurityDesc' required='N' />
        <field name='UnderlyingMaturityDate' required='N' />
        <field name='UnderlyingContractMultiplier' required='N' />
        <field name='IncrementPrice' required='N' />
        <field name='IncrementQty' required='N' />
        <field name='LotSize' required='N' />
        <field name='NumofCycles' required='N' />
        <field name='LotSizeMultiplier' required='N' />
        <field name='Clearable' required='N' />
        <field name='StripId' required='N' />
        <field name='StripType' required='N' />
        <field name='StripName' required='N' />
        <field name='HubId' required='N' />
        <field name='HubName' required='N' />
        <field name='HubAlias' required='N' />
        <field name='UnderlyingUnitOfMeasure' required='N' />
        <field name='PriceDenomination' required='N' />
        <field name='PriceUnit' required='N' />
        <field name='Granularity' required='N' />
        <field name='NumOfDecimalPrice' required='N' />
        <field name='NumOfDecimalQty' required='N' />
        <field name='ProductId' required='N' />
        <field name='ProductName' required='N' />
        <field name='ProductDescription' required='N' />
        <field name='TickValue' required='N' />
        <field name='ImpliedType' required='N' />
        <field name='PrimaryLegSymbol' required='N' />
        <field name='SecondaryLegSymbol' required='N' />
        <field name='IncrementStrike' required='N' />
        <field name='MinStrike' required='N' />
        <field name='MaxStrike' required='N' />
    </group>
</message>

实际消息:

  

8 = FIX.4.49 = 5004335 = D49 = ICE34 = 252 = 20121017-00:39:41.38556 = 600357 = 23322 = 3924323 = 4320 = 1393 = 1310382 = 13267 = 1711 = 100   311 = 1705282309 = TEB SMG0013-TFL SMG0013305 = 8463 = FXXXXX307 = NG Basis Futures Spr - TETCO-ELA / TGP-500L - Feb13542 = 20130131436 = 1.09013 = 0.00059014 = 2500.09017 = 25009022 = 289024 = 19025 = Y916 = 20130201917 = 201302289201 = 11969200 = 129202 = Feb139300 = 60589301 = Texas Eastern Transmission Corp. - East Louisiana Zone / Tennessee Gas Pipeline Co. - L区,500 Leg Pool9302 = TETCO-ELA / TGP-500L998 = MMBtus9100 = USD9101 = USD / MMBtu9085 = daily9083 = 49084 = 09061 = 4909062 = NG基础期货Spr9063 =天然气基准期货价差9032 = 1.259004 = 17051939005 = 1353778   311 = 1714677309 = PGE SQF0014.H0014-SCB SQF0014.H0014305 = 8463 = FXXXXX307 = NG Basis Futures Spr - PG&amp; E-Citygate / Socal-Citygate - Q1 14542 = 20131231436 = 1.09013 = 0.00059014 = 2500.09017 = 25009022 = 909024 = 19025 = Y916 = 20140101917 = 201403319201 = 12339200 = 159202 = Q1 149300 = 59979301 = PG&amp; E - Citygate / Socal - Citygate9302 = PG&amp; E-Citygate / Socal-Citygate998 = MMBtus9100 = USD9101 = USD / MMBtu9085 = daily9083 = 49084 = 09061 = 4909062 = NG基础期货Spr9063 =天然气基准期货价差9032 = 1.259004 = 13430529005 = 1344660

2 个答案:

答案 0 :(得分:2)

我们通过创建一个名为SecDefICE的自定义组件来解决这个问题,该组件包含所有自定义字段,并在自定义数据字典中重新定义SecurityDefinition消息。

我们现在能够阅读群组信息。唯一的缺点是我们必须使用通用组并按编号抓取字段,而不是以类型安全的方式执行。当我有时间的时候,我将创建一个新的命名空间(FIXICE等),它将具有正确的头文件(消息,字段,自定义破解程序等)

下面列出的是我们字典中的定义。

新组件

  <component name='SecDefICE' required='N'>
   <field name='UnderlyingSymbol' required='N' />
   <field name='UnderlyingSecurityID' required='N' />
   <field name='UnderlyingSecurityIDSource' required='N' />
   <field name='UnderlyingCFICode' required='N' />
   <field name='UnderlyingSecurityDesc' required='N' />
   <field name='UnderlyingMaturityDate' required='N' />
   <field name='UnderlyingContractMultiplier' required='N' />
   <field name='IncrementPrice' required='N' />
   <field name='IncrementQty' required='N' />
   <field name='LotSize' required='N' />
   <field name='NumofCycles' required='N' />
   <field name='LotSizeMultiplier' required='N' />
   <field name='Clearable' required='N' />
   <field name='StartDate' required='N' />
   <field name='EndDate' required='N' />
   <field name='StripId' required='N' />
   <field name='StripType' required='N' />
   <field name='StripName' required='N' />
   <field name='HubId' required='N' />
   <field name='HubName' required='N' />
   <field name='HubAlias' required='N' />
   <field name='UnderlyingUnitOfMeasure' required='N' />
   <field name='PriceDenomination' required='N' />
   <field name='PriceUnit' required='N' />
   <field name='Granularity' required='N' />
   <field name='NumOfDecimalPrice' required='N' />
   <field name='NumOfDecimalQty' required='N' />
   <field name='ProductId' required='N' />
   <field name='ProductName' required='N' />
   <field name='ProductDescription' required='N' />
   <field name='TickValue' required='N' />
   <field name='ImpliedType' required='N' />
   <field name='PrimaryLegSymbol' required='N' />
   <field name='SecondaryLegSymbol' required='N' />
   <field name='IncrementStrike' required='N' />
   <field name='MinStrike' required='N' />
   <field name='MaxStrike' required='N' />
  </component> 

新邮件定义

  <message name='SecurityDefinition' msgcat='app' msgtype='d'>
   <field name='SecurityResponseID' required='Y' />
   <field name='SecurityResponseType' required='Y' />
   <field name='SecurityReqID' required='Y' />
   <field name='TotNoRelatedSym' required='N' />
   <field name='NoRpts' required='N' />
   <field name='ListSeqNo' required ='N' />
   <group name='NoUnderlyings' required='N'>
    <component name='SecDefICE' required='N' />
   </group>
   <field name='Text' required='N' />
    <!-- these are the original fields in 4.4 spec -->
    <!-- group name='NoUnderlyings' required='N' -->
    <!-- component name='UnderlyingInst' required='N' -->
    <!-- /group -->
    <!-- component name='Instrument' required='N' -->
    <!-- component name='InstrumentExtension' required='N' -->
    <!-- field name='Currency' required='N' -->
    <!-- field name='TradingSessionID' required='N' -->
    <!-- field name='TradingSessionSubID' required='N' -->
    <!-- field name='EncodedTextLen' required='N' -->
    <!-- field name='EncodedText' required='N' -->
    <!-- group name='NoLegs' required='N' -->
    <!-- component name='InstrumentLeg' required='N' -->
    <!-- /group -->
    <!-- field name='ExpirationCycle' required='N' -->
    <!-- field name='RoundLot' required='N' -->
    <!-- field name='MinTradeVol' required='N' -->
  </message>

答案 1 :(得分:1)

如果这些标签不在您的配置文件中,请将它们添加到其中。我假设您的数据字典未被读取。

UseDataDictionary=Y

ValidateFieldsOutOfOrder=N   /* This caused a lot of grief for me, 
because of the underlying data structure used in QuickFix, 
hence I always put it to N to save me the pain */

但是我检查了FIX4.4的规格,这个消息确实存在于版本中,那么为什么要添加它呢?这应该在QuickFix提供的默认xml配置文件中。

您的第一组正在正确阅读,但第二组(两个305标签)导致错误。 Quickfix无法弄清楚有多少组和哪些组。而且你不必要地复制信息。您在邮件中使用这样的组。并且Quickfix无法正确解析您的邮件定义。这就是QuickFix的工作方式,因此你无法做任何事情。

 <group name="NoUnderlyings" required="N">
   <component name="UnderlyingInstrument" required="N" /> 
 </group>

否则,您需要在多个位置复制 UnderlyingInstrument ,如果它在多个消息中使用,并且它会增加您的XML大小而没有任何好处。 This is how it is done in the default Quickfix config file,请尝试遵循它,这会为您带来很多悲伤。