Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between "group" and "component" in QuickFIX/J

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?

like image 231
mrbela Avatar asked Apr 21 '15 12:04

mrbela


People also ask

What is component in FIX?

Description. The Parties component block is used to identify and convey information on the entities both central and peripheral to the financial transaction represented by the FIX message containing the Parties Block.

What is a QuickFix session?

A FIX session is defined in QuickFix/N as a unique combination of a BeginString (the FIX version number), a SenderCompID (your ID), and a TargetCompID (the ID of your counterparty). A SessionQualifier can also be used to disambiguate otherwise identical sessions.


2 Answers

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.

  1. 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>
    
  2. 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).

like image 83
Grant Birchmeier Avatar answered Sep 28 '22 22:09

Grant Birchmeier


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.

like image 20
Christoph John Avatar answered Sep 28 '22 21:09

Christoph John