we have a counterparty that implement FIX 4.2 standard to send executionReport messages (35=8).
In their specifications, they need a message in order to check the correct transmission. The strange thing is that the message type is "BN", that's not in 4.2 specs.
I've implemented a method in order to send such kind of message, and all works fine, but the quickfix put this message into the errorlog.
There is a way to tell quickfix to exclude from errorlog these "BN" messages?
Try editing the DataDictionary. I would create a new file. And set the DataDictionary location to the new file in your quickfix config file.
In the XML file for the data dictionary add an additional Message Type that to match what your counter party is sending you.
In the Message Type field:
<field number="35" name="MsgType" type="STRING">
add a line something like this:
<value enum="BN" description="MESSAGE_TYPE_NAME" />
where MESSAGE_TYPE_NAME is the correct description
Then add a type
<message name="ExecutionReportAck" msgtype="BN" msgcat="app">
<field name="OrderID" required="Y"/>
<field name="SecondaryOrderID" required="N"/>
<field name="ClOrdID" required="N"/>
...
</message>
Related
I've seen this questioned asked before here
and have applied the suggested solution but am still coming up with
Tag not defined for this message
I'm sending this message :
toapp : 8=FIX.4.4|9=151|35=V|34=2|49=Test|52=20180731-14:35:54.947|56=UAT-Test|55=EUR/USD|63=SP|115=Username|167=FOR|207=XCEL|262=1|263=1|264=0|265=0|461=SPOT|10=074|
and getting this back
toadmin : 8=FIX.4.4|9=134|35=3|34=3|49=Test|52=20180731-14:35:54.982|56=UAT-Test|45=2|58=Tag not defined for this message type|371=264|372=W|373=2|10=090|
The entry in the data dictionary for marketdatarequest is :
<message name="MarketDataRequest" msgtype="V" msgcat="app">
<field name="MDReqID" required="Y"/>
<field name="SubscriptionRequestType" required="Y"/>
<field name="MarketDepth" required="Y"/>
<field name="Symbol" required="Y"/>
<field name="SecurityType" required="Y"/>
<field name="MDUpdateType" required="Y"/>
<field name="CFICode" required="Y"/>
<field name="SettlType" required="Y"/>
<field name="OnBehalfOfCompID" required="N"/>
<field name="SecurityExchange" required="Y"/>
</message>
...
<field number="264" name="MarketDepth" type="INT"/>
All the other FIX implementations I've come across also have NoMDEntryTypes and NoRelatedSym groups which this does not which is strange but this is what the spec requires.
Also am I correct in saying that if I send an toapp message and get the toadmin message back with no fromapp/fromadmin message, does that mean quickfix intercepted the message as incorrectly formed and never sent it?
The rejection is not for your market data request. I can tell this from tag 372=W in the rejection:
FIX 4.4 : RefMsgType <372> field
The MsgType <35> (35) of the FIX message being referenced.
Source
MsgType W refers to a market data snapshot.
From the information you've given, I can infer that you send a MarketDataRequest (35=V) which presumably works successfully. The server you're connecting to replies with a snapshot (35=W) and your FIX engine then automatically responds to them with a rejection, because their snapshot includes tag 264 which are you not expecting.
Let's assume there is such part in quickfix's data dictionary
<message name="Name" msgtype="type">
<field name="field1" required="Y"/>
<field name="field2" required="Y"/>
<field name="field3" required="N"/>
<group name="group1" required="Y">
<field name="field4" required="Y"/>
</group>
<group name="group2" required="Y">
<field name="field5" required="Y"/>
<field name="field6" required="N"/>
</group>
</message>
While sending request, I need to construct message correctly - set field5 in group2, field4 in group1, and field1 outside of any group. Is there a way in quickfix library to know, for example, if field4 is in a group or not? And in which group?
If not, how is it possible to use quickfix library, if you are depending on data dictionary client will use? I should force clients to configure data dictionary as I configured it?
I should force clients to configure data dictionary as I configured it?
Yes. A server ("acceptor") and its clients ("initiators") should all be using the same DataDictionary.
If you are providing a server, you should provide documentation that defines exactly what messages/fields you support, and how use use those messages and fields. If you don't provide a QuickFIX data dictionary file, you should provide sufficient information so that client firms can create one.
Is there a way in quickfix library to know, for example, if field4 is in a group or not? And in which group?
I think you are asking this question because you don't really know what you're doing yet. :)
I think there might be DD methods for this, but I can't really remember because they're not something people usually need. I don't think this is the right approach for whatever your problem is.
I'm getting an exec report from my counter party, and my quickfix engine is rejecting it for "Tag not defined for this message type 371=1300"
It seems to be saying that the exec report has a non-standard tag (1300), and my quickfix engine doesn't like it.
However, I have added that tag into my dictionary XML file, as follows
<field number="1300" name="MarketSegmentID" type="String" added="FIX.5.0" addedEP="52" abbrName="MktSegID" textId="FIELD_1300">
<enum value="BETP" symbolicName="BETP" textId="ENUM_1300_BETP"/>
<enum value="BGL" symbolicName="BGL" textId="ENUM_1300_BGL"/>
<enum value="BMTF" symbolicName="BMTF" textId="ENUM_1300_BMTF"/>
<enum value="BSEF" symbolicName="BSEF" textId="ENUM_1300_BSEF"/>
</field>
So it should know about tag 1300. My counter party sends "1300=BSEF", so it's one of the valid choices.
What exactly does "tag not defined for this message type" mean? What should I try?
There are two main sections to your XML file: (1) The message definitions, and (2) the tag definitions.
You added the tag definition, but you didn't edit the ExecutionReport message definition to include that new tag.
I am new to the FIX world. I am writing an application processing FIX messages in Java and for that I am using QuickFIX/J. I have downloaded the DataDictionary from the homepage (http://quickfixengine.org/). I am using the version 4.4.
In the XML-file exist groups and components. But a component can contain groups again.
What's the exact difference between them?
Components aren't really... things. They're like macros in the FIX DataDictionary (DD). Many messages need the same set of fields, so instead of specifying the same fields in every message, the DD defines a component that other messages can include.
A Group, on the other hand, is a very real thing. It's a repeating sequence of fields that will appear 0 or more times in a message.
QuickFIX's (QF) programming interface largely ignores components as a concept. You can't extract a component from a message because a component isn't a concept in QF; you just extract the fields like any other field.
A hypothetical example: The following two message definitions are exactly the same.
With a component
<message name="Automobile" msgtype="X" msgcat="app">
<field name="Wheel" required="Y"/>
<field name="Bumper" required="Y"/>
<component name="Dashboard" required="Y"/>
</message>
<component name="Dashboard">
<field name="Radio" required="Y"/>
<field name="AirConditioner" required="Y"/>
<field name="Heater" required="Y"/>
</component>
Without a component
<message name="Automobile" msgtype="X" msgcat="app">
<field name="Wheel" required="Y"/>
<field name="Bumper" required="Y"/>
<field name="Radio" required="Y"/>
<field name="AirConditioner" required="Y"/>
<field name="Heater" required="Y"/>
</message>
See? A component is pretty much just a macro.
Either way it's defined, you just end up calling msg.GetHeater() (or whatever).
From the FIXWiki for Components:
Component blocks are sets of related data fields grouped together and are referenced by the component block name in messages that they are used in. Sometimes they are referred to as "Groups".
Component blocks are practical to be defined, and then reused in different message types. Sometimes a repeating group is just for one particular message and then it is not defined as a Component block.
View a component block as a reusable definition of fields. Such a component block may or may not contain a repeating group of fields.
For instance take the Parties component block which is used in many different messages types (see "Used In" on that page). Easy to define once and use in many definitions of messages.
Just going to add some information since the accepted answer is missing this information (probably due to the fact that it is about five years old now).
In QuickFIX/J you are actually able to get and set components. So you can for example simply copy the Instrument component from one message to another.
#Test
public void testComponent() throws Exception {
final Instrument instrument = new Instrument();
instrument.set(new Symbol("DELL"));
instrument.set(new CountryOfIssue("USA"));
instrument.set(new SecurityType(SecurityType.COMMON_STOCK));
final quickfix.fix44.NewOrderSingle newOrderSingle = new quickfix.fix44.NewOrderSingle();
newOrderSingle.set(instrument);
final quickfix.fix44.ExecutionReport executionReport = new quickfix.fix44.ExecutionReport();
executionReport.setComponent(newOrderSingle.getInstrument());
System.out.println("NOS: " + newOrderSingle.toString().replace('\001', '|'));
System.out.println("ER: " + executionReport.toString().replace('\001', '|'));
}
Output:
NOS: 8=FIX.4.4|9=28|35=D|55=DELL|167=CS|470=USA|10=233|
ER: 8=FIX.4.4|9=28|35=8|55=DELL|167=CS|470=USA|10=221|
Maybe this is also possible in the other QuickFIX language variants.
I need to add/modify fields in the FIX4.4 dictionary. I haven't found any helpful documentation or tutorials on this.
I'm guessing I have to modify the FIX44.xml file, but I'm not sure how exactly to do that.
In the <message></message> tags I don't see any attributes that define the number or the type(format) of that field. I see just the name and required attributes.
I think I found attributes I', looking for in the <fields></fields> tags.
I'm not sure if I'm looking in the right place or if I'm doing the right thing, but according to this I should modify the dictionary if it is necessary.
Please help.
A link to a tutorial for beginners that can help me would also be greatly appreciated.
The FIX Data Dictionary in QuickFIX contains Messages and Fields (among other things).
To add Messages you must add the message between the <messages></messages> tags like this:
<message name="CoolMessage" msgcat="app" msgtype="xCM">
<field name="Currency" required="N"/>
<field name="Text" required="N"/>
<field name="Account" required="Y"/>
</message>
And then add the new msgtype to the MsgType field in the <fields></fields> section like this:
<field number='35' name='MsgType' type='STRING'>
...
<value enum='xCM' description='COOLMESSAGE'/>
</field>
If you want to add new fields, just add them between the <fields></fields> tags like this:
<fields>
<field number="1" name="Account" type="STRING"/>
<field number="2" name="AdvId" type="STRING"/>
<field number="3" name="AdvRefID" type="STRING"/>
...
<field number="9006" name="AwesomeField" type="STRING"/>
</fields>
This and more information can be found in this tutorial.