Search code examples
fix-protocol

Tag not defined for this message type for MarketDataRequest


Case I: I'm sending the MarketDataRequest (35=V) to the FIX server and I am getting MARKET_DATA_REQUEST_REJECT answer (35=Y) with the text 58=RequestValidationError.ProductNotSet.

Case II: I'm adding to the request a field Product with the value CURRENCY (460=4) and sending it one more time. In result I get a REJECT answer (35=3) with the text 58=Tag not defined for this message type also with RefTagID pointing to Product (371=460). I'm confused!

Here is my C# code for request:

MDReqID mdReqID = new MDReqID("MARKETDATAID");
SubscriptionRequestType subType = new SubscriptionRequestType(SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES);
MarketDepth marketDepth = new MarketDepth(1);

QuickFix.FIX44.MarketDataRequest.NoRelatedSymGroup symbolGroup = new QuickFix.FIX44.MarketDataRequest.NoRelatedSymGroup();
symbolGroup.Set(new Symbol("EUR/USD"));

QuickFix.FIX44.MarketDataRequest message = new QuickFix.FIX44.MarketDataRequest(mdReqID, subType, marketDepth);
message.MDUpdateType = new MDUpdateType(0);

QuickFix.FIX44.MarketDataRequest.NoMDEntryTypesGroup marketDataEntryGroup = new QuickFix.FIX44.MarketDataRequest.NoMDEntryTypesGroup();
marketDataEntryGroup.Set(new MDEntryType(MDEntryType.BID));
message.AddGroup(marketDataEntryGroup);
marketDataEntryGroup.Set(new MDEntryType(MDEntryType.OFFER));
message.AddGroup(marketDataEntryGroup);

message.AddGroup(symbolGroup);

message.SetField(new QuickFix.Fields.DeliverToCompID("ALL"));
message.SetField(new QuickFix.Fields.Product(QuickFix.Fields.Product.CURRENCY));

Here are the request and respond related to Case I:

ToApp 8=FIX.4.4 9=165 35=V 34=2 49=XXXX 50=YYYY 52=20141227-10:11:27.728 56=demo.fxgrid 128=ALL 262=MARKETDATAID 263=1 264=1 265=0 267=2 269=0 269=1 146=1 55=EUR/USD 10=104 
FromApp 8=FIX.4.4 9=138 35=Y 34=2 49=demo.fxgrid 52=20141227-10:11:28.716 56=XXXX 58=RequestValidationError.ProductNotSet 262=MARKETDATAID 281=3 10=218 

Here are the request and respond related to Case II:

ToApp 8=FIX.4.4  9=171  35=V  34=2  49=XXXX  50=YYYY  52=20141227-10:19:59.744  56=demo.fxgrid  128=ALL  262=MARKETDATAID  263=1  264=1  265=0  460=4  267=2  269=0  269=1  146=1  55=EUR/USD  10=124  
FromAdmin 8=FIX.4.4  9=161  35=3  34=2  49=demo.fxgrid  52=20141227-10:20:00.741  56=XXXX  57=YYYY  115=ALL  45=2  58=Tag not defined for this message type  371=460  372=V  373=2  10=221  

Solution

  • Case 1: This is not a FIX or QuickFIX error. Your message was valid per FIX protocol, but it's not what your counterparty expects.

    That error message in tag 58 was set by your counterparty. It sounds like you haven't read your counterparty's documentation that tells you what fields they expect you to set.

    Case 2: Tag 460 doesn't belong to the top level of the MarketDataRequest message per the default FIX message definitions. Thus, it's an illegal message. (It sounds like you are new to FIX, because this is kind of a newbie mistake.)

    Note: Your counterparty is probably using a modified version of the default definitions, so you'll also need to modify your FIX44.xml DataDictionary file to match their definitions. Again, this will be in their docs.

    BOTTOM LINE: Read your counterparty's docs before you do any more development!