How to make Quickfixj NoTradingSessions appear before TradingSessionID for custom DD?

Hello!

My question is - how rewrite Fix 4.4 New Order - Single (MsgType = ‘D’) DD: https://github.com/quickfix-j/quickfixj/blob/master/quickfixj-messages/quickfixj-messages-fix44/src/main/resources/FIX44.modified.xml

to conform with Fix message structure from image( http://ftp.moex.com/pub/FIX/ASTS/docs/public_fix44_interface_in_eng_v_4_8_1.pdf)?

The content you reference on GitHub seems to follow the same order as your image:

  <message name="NewOrderSingle" msgtype="D" msgcat="app">
    ...
    <group name="NoTradingSessions" required="N">
      <field name="TradingSessionID" required="N"/>
      <field name="TradingSessionSubID" required="N"/>
    </group>

Can you be more specific as to what the problem is?

1 Like

That’s my code:

quickfix.fix44.MessageFactory messageFactory = new quickfix.fix44.MessageFactory();
quickfix.fix44.NewOrderSingle message =(quickfix.fix44.NewOrderSingle) messageFactory.create(“FIX.4.4”, NewOrderSingle.MSGTYPE);
quickfix.fix44.NewOrderSingle.NoTradingSessions tradingSessions = new quickfix.fix44.NewOrderSingle.NoTradingSessions();
message.set(tradingSessions);

but last line not compiles because quickfix.fix44.NewOrderSingle has setter only for quickfix.field.NoTradingSessions but not quickfix.fix44.NewOrderSingle.NoTradingSessions:
public void set(quickfix.field.NoTradingSessions value) {

I can’t use quickfix.field.NoTradingSessions because: public NoTradingSessions() { super(386);}
but in quickfix.fix44.NewOrderSingle.NoTradingSessions:
private static final int[] ORDER = {336, 625, 0};
public NoTradingSessions() { super(386, 336, ORDER);

What is the correct way to create signle order in Fix 4.4?

Don’t know if this is too specific for this forum. When searching programming help for QFJ you might be better off using StackOverflow (is this your question https://stackoverflow.com/q/75542907/4962355 ?) or use the discussion forum on https://github.com/quickfix-j/quickfixj/discussions.

In short, you do not need to explicitly set any of the No* fields since QFJ will calculate the number of repeating group entries.
Here is an example on how to set repeating groups: https://www.quickfixj.org/usermanual/2.3.0/usage/repeating_groups.html

Hope that helps!

1 Like