QuickFIX不验证重复组

时间:2015-04-16 17:43:19

标签: c++ quickfix

我实现了基于QuickFIX的客户端 - 服务器集。当我尝试发送包含缔约方重复组的消息时,我得到了拒绝,其中包含以下描述:" 58 =未为此消息类型定义标记| 371 = 447 |"

我尝试发送的消息类型是OrderCancelReplaceRequest。

代码示例是:

FIX44::OrderCancelReplaceRequest order(FIX::MsgType("G"));

FIX44::OrderCancelReplaceRequest::NoPartyIDs party;
// 448-PartyID
party.set(FIX::PartyID("PartyId"));
// 447-PartyIDSource
party.set(FIX::PartyIDSource('B'));    
// 452-PartyRole
party.set(FIX::PartyRole(1));    
// 802-NoPartySubIDs
party.set(FIX::NoPartySubIDs(0));

order.addGroup(party);

...

如果邮件中不包含任何Party组,则服务器会成功验证该邮件。

此外,即使它包含FIX44 :: OrderCancelReplaceRequest :: NoAllocs组,它也已成功验证:

 FIX44::OrderCancelReplaceRequest::NoAllocs alloc;
 // 79-AllocAccount
 alloc.set(FIX::AllocAccount("Alloc Account"));
 // 80-AllocQty
 alloc.set(FIX::AllocQty(4.2));
 order.addGroup(alloc);

所以,我只有在尝试使用缔约方小组时才会看到这个问题。

服务器的配置文件是:

[DEFAULT]
ConnectionType=acceptor
SocketAcceptPort=28663
SocketReuseAddress=Y
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=Y
DataDictionary=<some path here>/FIX44.xml
FileLogPath=QuickFixServerLog
ValidateUserDefinedFields=N

[SESSION]
BeginString=FIX.4.4
SenderCompID=EXECUTOR
TargetCompID=CLIENT1
FileStorePath=store

客户端的配置文件是:

[DEFAULT]
ConnectionType=initiator
ReconnectInterval=1
FileStorePath=store
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=Y
DataDictionary=<some path here>/FIX44.xml
HttpAcceptPort=9911
ValidateUserDefinedFields=N
ResetOnLogout=Y
ResetOnLogon=Y

[SESSION]
BeginString=FIX.4.4
SenderCompID=CLIENT1
TargetCompID=EXECUTOR
SocketConnectHost=127.0.0.1
SocketConnectPort=28663
HeartBtInt=15

UPD。

服务器重新发送的请求示例(来自服务器日志):

8=FIX.4.4|9=234|35=G|34=2|49=CLIENT1|52=20150417-10:49:07.715|56=EXECUTOR|1=Account|11=Id123|38=11.11|40=1|41=OrigId321|44=4.2|54=2|55=Symbol|60=20150417-10:49:07|78=2|79=AllocAccount1|79=AllocAccount2|80=10|80=20|447=B|448=PartyId|452=1|453=1|802=0|10=185|

该请求的响应是:

8=FIX.4.4|9=124|35=3|34=2|49=EXECUTOR|52=20150417-10:49:07.719|56=CLIENT1|45=2|58=Tag not defined for this message type|371=447|372=G|373=2|10=060|

2 个答案:

答案 0 :(得分:1)

正如您在评论部分中的对话后所指出的那样,<Parties> component block组中字段的顺序不正确。应保留重复组(或<Parties>的组件块)中的字段顺序。您可以找到关于该主题的here博客文章,解释重复组中字段顺序的重要性。

在您的情况下,客户端对邮件的修改搞砸了<Parties>组的字段顺序,从而导致来自服务器的Reject消息。

答案 1 :(得分:0)

@TT我的10美分。 Fiximate是你的朋友。

在我的FIX4.4数据字典中,我可以看到,对于消息类型OrderCancelReplaceRequest,未定义标签447 PartyIDSource。我附上我的数据字典消息。

如果您需要定义PartyIDSource,请将其添加到数据字典中。

<message name="OrderCancelReplaceRequest" msgtype="G" msgcat="app">
    <field name="OrderID" required="N" />
    <component name="Parties" required="N" />
    <field name="TradeOriginationDate" required="N" />
    <field name="TradeDate" required="N" />
    <field name="OrigClOrdID" required="Y" />
    <field name="ClOrdID" required="Y" />
    <field name="SecondaryClOrdID" required="N" />
    <field name="ClOrdLinkID" required="N" />
    <field name="ListID" required="N" />
    <field name="OrigOrdModTime" required="N" />
    <field name="Account" required="N" />
    <field name="AcctIDSource" required="N" />
    <field name="AccountType" required="N" />
    <field name="DayBookingInst" required="N" />
    <field name="BookingUnit" required="N" />
    <field name="PreallocMethod" required="N" />
    <field name="AllocID" required="N" />
    <group name="NoAllocs" required="N">
      <field name="AllocAccount" required="N" />
      <field name="AllocAcctIDSource" required="N" />
      <field name="AllocSettlCurrency" required="N" />
      <field name="IndividualAllocID" required="N" />
      <component name="NestedParties" required="N" />
      <field name="AllocQty" required="N" />
    </group>
    <field name="SettlType" required="N" />
    <field name="SettlDate" required="N" />
    <field name="CashMargin" required="N" />
    <field name="ClearingFeeIndicator" required="N" />
    <field name="HandlInst" required="N" />
    <field name="ExecInst" required="N" />
    <field name="MinQty" required="N" />
    <field name="MaxFloor" required="N" />
    <field name="ExDestination" required="N" />
    <group name="NoTradingSessions" required="N">
      <field name="TradingSessionID" required="N" />
      <field name="TradingSessionSubID" required="N" />
    </group>
    <component name="Instrument" required="Y" />
    <component name="FinancingDetails" required="N" />
    <group name="NoUnderlyings" required="N">
      <component name="UnderlyingInstrument" required="N" />
    </group>
    <field name="Side" required="Y" />
    <field name="TransactTime" required="Y" />
    <field name="QtyType" required="N" />
    <component name="OrderQtyData" required="Y" />
    <field name="OrdType" required="Y" />
    <field name="PriceType" required="N" />
    <field name="Price" required="N" />
    <field name="StopPx" required="N" />
    <component name="SpreadOrBenchmarkCurveData" required="N" />
    <component name="YieldData" required="N" />
    <component name="PegInstructions" required="N" />
    <component name="DiscretionInstructions" required="N" />
    <field name="TargetStrategy" required="N" />
    <field name="TargetStrategyParameters" required="N" />
    <field name="ParticipationRate" required="N" />
    <field name="ComplianceID" required="N" />
    <field name="SolicitedFlag" required="N" />
    <field name="Currency" required="N" />
    <field name="TimeInForce" required="N" />
    <field name="EffectiveTime" required="N" />
    <field name="ExpireDate" required="N" />
    <field name="ExpireTime" required="N" />
    <field name="GTBookingInst" required="N" />
    <component name="CommissionData" required="N" />
    <field name="OrderCapacity" required="N" />
    <field name="OrderRestrictions" required="N" />
    <field name="CustOrderCapacity" required="N" />
    <field name="ForexReq" required="N" />
    <field name="SettlCurrency" required="N" />
    <field name="BookingType" required="N" />
    <field name="Text" required="N" />
    <field name="EncodedTextLen" required="N" />
    <field name="EncodedText" required="N" />
    <field name="SettlDate2" required="N" />
    <field name="OrderQty2" required="N" />
    <field name="Price2" required="N" />
    <field name="PositionEffect" required="N" />
    <field name="CoveredOrUncovered" required="N" />
    <field name="MaxShow" required="N" />
    <field name="LocateReqd" required="N" />
    <field name="CancellationRights" required="N" />
    <field name="MoneyLaunderingStatus" required="N" />
    <field name="RegistID" required="N" />
    <field name="Designation" required="N" />
  </message>