Support custom field addition on f8c command line


In an automated system directing generation of the Fix8 compiler, we will need to be able to specify additional fields to the compiler outside of the given xml schema document. These should take the form of a single switch with repetitions of Field(tag, type, description, domain etc) + (messages with this field in it, mandatory/optional, etc).




David Dight
December 30, 2013, 11:03 AM

Ideas for the command line format. I am thinking we should retain xml and add additional attributes to specify the messages, e.g.

The -F parameter says: add fields 9999 named SampleUserField of type STRING and 9991 named SampleUserField2 of type STRING; insert the field into NewOrderSingle (mandatory), ExecutionReport (mandatory) and OrderCancelRequest (optional). Note we need to use ' for attributes so we can separate " for the entire parameter.

David Dight
January 14, 2014, 1:23 AM

You can declare additional FIX fields and specify which messages those fields should reside by using this option. The purpose of this functionality is to give script driven applications the power to add fields without rewriting the primary XML schema. Typically applications that need to modify FIX schemas often only need to add custom fields. Using this option, this can be achieved without rewriting the full schema.
The syntax for the field is identical to that used in the xml schema. Multiple fields can be specified. There is however an additional attribute messages that is required. The following example demonstrates the syntax:
Example parameter syntax

This describes a field with the tag name SampleUserField with the tag number 9999 of type STRING. The messages attribute lists three messages where this field is used. In NewOrderSingle and ExecutionReport it is mandatory. In OrderCancelRequest it is optional.

May 3, 2014, 6:00 AM


I add this command in but when I want to use custom field in my program it gets me error: expected type-specifier
how can I add and use custom filed in fix8?

kindly help me

David Dight
May 3, 2014, 1:28 PM

Look at the wiki for instructions on using this switch and look at ./utests/ and ./utests/message_test.cpp for examples of use.

May 4, 2014, 5:41 AM

Thanks so much for your reply

I edit ./test/ as described in ./utest/ such as:

EXTRA_FIELDS = "<field number='9999' name='SampleUserField' type='STRING' messages='NewOrderSingle:N ExecutionReport:N OrderCancelRequest:Y' />\
<field number='9991' name='SampleUserField2' type='STRING' messages='NewOrderSingle:N ExecutionReport:N OrderCancelRequest:Y' />"

$(libmyfix_la_SOURCES): $(XML_SCHEMA)
$(top_srcdir)/compiler/f8c -rVn TEX $(XML_SCHEMA) -x $(XML_FIXT_SCHEMA) -F $(EXTRA_FIELDS)

and then edit ./test/myfix.cpp such as:

TEX::NewOrderSingle *nos(new TEX::NewOrderSingle);
*nos << new TransactTime("20150304-09:19:46.108")
<< new Account("4567")
<< new TEX::SampleUserField("AAA");

but when I compile (make and make install) give me error: myfix.cpp: error: expected type-specifier: new TEX::SampleUserField("AAA");

what do I do wrong?

sorry for my bad english, Thanks alot.


David Dight


David Dight







Fix versions

Affects versions