Reputation: 327
I am using Quickfix and stunnel to connect to server with RSA private key.
When I am sending Market Data Request(MsgType=V), I am getting the following error
8=FIX.4.49=14735=Y34=55349=ABCD52=20130513-03:23:23.24356=ABCDEFGHI58=Field [5232] was not found in message.262=85ee75f8-ab5d-4aff-b87d-108b74d3281=010=53
i searched and found from this link that 5232 is Currency field
So I passed Currency value to 5232 as below
Message message = new Message();
................
message.setField(5232, new quickfix.field.Currency("EUR"));
................
Session.sendToTarget(message, sessId);
But when i checked the code of outgoing message, i found that the field 5232 is automatically converted to '15=EUR', and its again giving error 'Field [5232] was not found in message'
Can anyone point out what I am missing here ?
Upvotes: 2
Views: 2212
Reputation: 327
Thanks to all who replied this thread. I will explain the steps I followed to solve the issue
UseDataDictionary=Y
ValidateUserDefinedFields=N
ValidateFieldsOutOfOrder=N
ValidateFieldsHaveValues=N
DataDictionary=/var/www/FIX44_edited.xml
<message name="MarketDataRequest" msgtype="V" msgcat="app">
<field name="MDReqID" required="Y"/>
<field name="SubscriptionRequestType" required="Y"/>
<field name="MarketDepth" required="Y"/>
<field name="MDUpdateType" required="N"/>
<field name="AggregatedBook" required="N"/>
<field name="OpenCloseSettlFlag" required="N"/>
<field name="Scope" required="N"/>
<field name="MDImplicitDelete" required="N"/>
<group name="NoMDEntryTypes" required="Y">
<field name="MDEntryType" required="Y"/>
</group>
<group name="NoRelatedSym" required="Y">
<component name="Instrument" required="Y"/>
<group name="NoUnderlyings" required="N">
<component name="UnderlyingInstrument" required="N"/>
</group>
<group name="NoLegs" required="N">
<component name="InstrumentLeg" required="N"/>
</group>
</group>
<group name="NoTradingSessions" required="N">
<field name="TradingSessionID" required="N"/>
<field name="TradingSessionSubID" required="N"/>
</group>
<field name="ApplQueueAction" required="N"/>
<field name="ApplQueueMax" required="N"/>
<field name="CurrencyNew" required="Y"/>
</message>
and
<field number="5232" name="CurrencyNew" type="STRING"/>
define the field 5232 with a unique name (i gave "CurrencyNew"), and use the field inside the message in which you need to use the custom variable 5232.
Message message = new Message();
quickfix.fix44.MarketDataRequest.NoRelatedSym group = new quickfix.fix44.MarketDataRequest.NoRelatedSym();
StringField currency= new StringField(5232, "EUR");
group.setField(currency);
message.addGroup(group);
Hope this helps anyone who is stuck in generating data dictionary :)
Upvotes: 0
Reputation: 18484
I see multiple problems and misconceptions here.
message.setField(5232,"EUR")
, but that is probably still wrong. Read on.So, with all that, here's what you need to do:
Get your counterparty's documentation for this FIX interface. You need to find out what 5232 is and how they expect you to use it, and if it's within one of the message's repeating groups or not.
Also, if they've added 5232, they've probably added other fields too. You need to know all of their customizations.
Update your FIX44.xml file to reflect those changes. You need to do this, else your engine will reject messages with unexpected fields. This file is pretty easy to understand. The message defs are at the top section, the field defs are at the bottom section.
Rebuild QuickFIX/J engine (optional but recommended). See the FAQ entry "Should I regenerate/rebuild QF/J?" to why and how to do it.
After all that, things should make more sense to you.
Upvotes: 0
Reputation: 1163
typically the tags > 1000 are custom tags. In order to implement your message correclty, take a look to the counteraprty specifications, and edit the FIX dictionary (for 4.4 version) accordingly.
The standard Market Data Reques message has this structure:
http://www.onixs.biz/fix-dictionary/4.4/msgType_V_86.html
and there is no tag #5232 in it.
Upvotes: 0
Reputation: 7624
I am a bit confused about the field number but regardless the error that you are making is that the request must have a group and the currency field must be in that group.
Here is an example:
MarketDataRequest marketDataRequest = new MarketDataRequest();
String reqID = symbol+new Date().getTime(); //unique ID
marketDataRequest.setString(MDReqID.FIELD,reqID); // set ID
char requestType = SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES;
marketDataRequest.setChar(SubscriptionRequestType.FIELD,requestType); // set update type
marketDataRequest.setInt(MarketDepth.FIELD, 0);
marketDataRequest.setInt(MDUpdateType.FIELD, 0);
MarketDataRequest.NoMDEntryTypes entryTypes = new MarketDataRequest.NoMDEntryTypes(); // create group to request both bid and offers
entryTypes.set(new MDEntryType(MDEntryType.BID));
marketDataRequest.addGroup(entryTypes);
entryTypes.set(new MDEntryType(MDEntryType.OFFER));
marketDataRequest.addGroup(entryTypes);
MarketDataRequest.NoRelatedSym noRelatedSym = new MarketDataRequest.NoRelatedSym(); // create group to add list of symbols
noRelatedSym.set(new Symbol(getSymbol(symbol)));
marketDataRequest.addGroup(noRelatedSym);
As you can see some fields must first be entered into a group and then into the message.
There should be a dictionary definition called FIX44.xml that will show you the structure of the message. its in the quickfix/etc/
directory.
Upvotes: 1