QuickFix市场数据消息错误

时间:2016-06-23 11:24:33

标签: c# quickfix fix-protocol

我是新手修理。我在我的应用程序中使用快速修复库。我能够做登录和交换心跳。当我发送marketdata请求时,我从服务器获取响应。但是我的应用程序在收到消息时发送拒绝消息来修复。所以我无法处理消息。以下是传入和传出的消息。

20160623-11:19:45.898 : 8=FIX.4.49=24235=X34=12049=CfhDemoPrices52=20160623-11:19:46.41456=PrimoDEMOFIX262=PrimoApp123268=2279=1269=0278=30/23-14404955=GBPUSD270=1.48854271=1500000290=164=20160627279=1269=1278=30/23-14405455=GBPUSD270=1.48885271=1000000290=110=004
20160623-11:19:45.924 : 8=FIX.4.49=13735=334=12249=PrimoDEMOFIX52=20160623-11:19:45.92256=CfhDemoPrices45=12058=Tag not defined for this message type371=55372=X373=210=140

及以下是我订阅市场数据的方式:

        QuickFix.FIX44.MarketDataRequest msg = new QuickFix.FIX44.MarketDataRequest();

        // Fill message fields
        msg.SetField(new MDReqID("PrimoApp123"));
        msg.SetField(new SubscriptionRequestType('1'));
        msg.SetField(new MarketDepth(1));
        msg.SetField(new MDUpdateType(1));

        // Add the MDEntryTypes group
        QuickFix.FIX44.MarketDataRequest.NoMDEntryTypesGroup noMDEntryTypes = new QuickFix.FIX44.MarketDataRequest.NoMDEntryTypesGroup();
        noMDEntryTypes.SetField(new MDEntryType('0'));
        msg.AddGroup(noMDEntryTypes);

        // Add the NoRelatedSym group
        QuickFix.FIX44.MarketDataRequest.NoRelatedSymGroup noRelatedSym = new QuickFix.FIX44.MarketDataRequest.NoRelatedSymGroup();
        noRelatedSym.SetField(new Symbol("GBPUSD"));
        msg.AddGroup(noRelatedSym);

        // Send message
        Session.SendToTarget(msg, FeederApp.mysession);

请尽可能帮助我

1 个答案:

答案 0 :(得分:0)

您是否看过拒绝留言的内容?

45=120   // RefSeqNum - seq num of message that was rejected
58=Tag not defined for this message type
371=55   // RefTagID - tag 55 is the problem
372=X    // RefMsgType - the rejected message was an X (MarketDataIncrementalRefresh)
373=2    // SessionRejectReason 2=[TagNotDefinedForThisMessageType]

因此,根据这一点,问题是您的DataDictionary未配置为期望消息类型X中的标记55(符号)。

然而,这似乎并不完全准确。如果你的粘贴信息是正确的,它会像这样分解:

8 =FIX.4.4
9 =242
35 =X
34 =120
49 =CfhDemoPrices
52 =20160623-11:19:46.414
56 =PrimoDEMOFIX
262 =PrimoApp123
268 =2     // 2 MDEntry Sequences
  279 =1   // 1st sequence
  269 =0
  278 =30/23-144049
  55 =GBPUSD     // this looks ok here...
  270 =1.48854
  271 =1500000
  290 =1
  64 =20160627  // what?  this doesn't belong here!

  279 =1   // 2nd sequence
  269 =1
  278 =30/23-144054
  55 =GBPUSD
  270 =1.48885
  271 =1000000
  290 =1

10=004

因此,我怀疑(1)您在复制/粘贴邮件时出错,或(2)实际上是字段64,这是您的问题。

后续步骤:

1)阅读本页以了解如何自定义DataDictionary:
http://quickfixn.org/tutorial/custom-fields-groups-and-messages.html

2)从您的对手方获取文档,并确保您的DataDictionary反映了他们已添加到系统中的所有字段/消息自定义。