Can't set value for field "Symbol" with message type "MarketDataRequest"

378 views Asked by At

While using quickfix for c++, I can't seem to set the field "Symbol" for the message type MarketDataRequest. It throws the exception "Tag not defined for this message type". How can I get around this? Below is the excerpt of the code which instantiates the message

FIX44::MarketDataRequest marketDataRequest;
LastClOrdID = LastClOrdID + 1;
marketDataRequest.set(FIX::MDReqID(to_string(LastClOrdID)));
marketDataRequest.set(FIX::SubscriptionRequestType('0'));
marketDataRequest.setField(55,"DOLM15");
queryHeader(marketDataRequest.getHeader());
return marketDataRequest;

Thanks in advance!

1

There are 1 answers

1
Grant Birchmeier On BEST ANSWER

The "Symbol" field is not a top-level field in MarketDataRequest.

It's in the repeating group that starts with tag 146 "NoRelatedSym". A MarketDataRequest can contain multiple symbols, and repeating groups are the mechanism which enables this.

Please read the QF doc page about repeating groups.