1

I'm currently using QuickFIX/n to build an acceptor service, and I've built an initiator to test the acceptor. I suspect the error I get is due to a bug in the acceptor because the same error occurs with a message that someone else is sending to the service.

In the initiator I build and send an AllocationInstruction as follows:

var fix44Message = new QuickFix.FIX44.AllocationInstruction(
    new AllocID(request.Info.AllocationID), EnumHelpers.ParseAllocationTransactionType(request.Info.AllocationTransactionType), EnumHelpers.ParseAllocationType(request.Info.AllocationType),
    new AllocNoOrdersType(AllocNoOrdersType.EXPLICIT_LIST_PROVIDED), EnumHelpers.ParseSide(request.Info.Side), new Symbol(request.Info.Symbol), new Quantity(request.Info.Quantity),
    new AvgPx(request.Info.AveragePrice), new TradeDate(request.Info.TradeDate.ToString("yyyyMMdd")))
    {
        SecurityID = new SecurityID(request.Info.SecurityID),
        SecurityIDSource = new SecurityIDSource(request.Info.SecurityIDSource),
        SecurityExchange = new SecurityExchange(request.Info.SecurityExchange),
        Issuer = new Issuer(request.Info.Issuer),
        Currency = new Currency(request.Info.Currency),
        TransactTime = new TransactTime(request.Info.TransactTime),
        SettlDate = new SettlDate(request.Info.SettlementDate.ToString("yyyyMMdd")),
        GrossTradeAmt = new GrossTradeAmt(request.Info.GrossTradeAmount),
        NetMoney = new NetMoney(request.Info.NetMoney)
    };

var group = new QuickFix.FIX44.AllocationInstruction.NoOrdersGroup
{
    ClOrdID = new ClOrdID(order.ClOrdID),
    OrderID = new OrderID(order.OrderID),
    OrderQty = new OrderQty(order.Quantity)
};
fix44Message.AddGroup(group);

In this specific case the message is created with exactly one order group.

In the acceptor I try get the order-groups as follows:

public void OnMessage(QuickFix.FIX44.AllocationInstruction allocation, SessionID sessionID)
{
    Console.WriteLine("Order count: " + allocation.NoOrders.getValue());
    var orderGroup = new QuickFix.FIX44.AllocationInstruction.NoOrdersGroup();
    allocation.GetGroup(1, orderGroup);
    info.Orders.Add(new AllocationInstructionOrder
    {
        ClOrdID = orderGroup.ClOrdID.getValue(),
        OrderID = orderGroup.OrderID.getValue(),
        Quantity = orderGroup.OrderQty.getValue()
    });
}

allocation.NoOrders has a value of 1 as expected. However, when GetGroup() is called with an index of 1 (first group), I get

QuickFix.FieldNotFoundException occurred
  HResult=-2146232832
  Message=field not found for tag: 73
  Source=QuickFix
  Field=73
  StackTrace:
       at QuickFix.FieldMap.GetGroup(Int32 num, Int32 field)
       at QuickFix.FieldMap.GetGroup(Int32 num, Group group)
       at FIX.FixAcceptorService.AcceptorExchange.OnMessage(AllocationInstruction allocation, SessionID sessionID) in c:\Projects\AdHoc\FIX\FIX\FIX\FixAcceptorService\AcceptorExchange.cs:line 82
  InnerException: 

This is the FIX message log:

20151008-06:03:57.410 : 8=FIX.4.4 9=65 35=A 34=1 49=TEST 52=20151008-06:03:57.388 56=BAOBAB 98=0 108=30 10=225 
20151008-06:03:57.444 : 8=FIX.4.4 9=65 35=A 34=1 49=BAOBAB 52=20151008-06:03:57.440 56=TEST 98=0 108=30 10=214 
20151008-06:04:04.162 : 8=FIX.4.4 9=258 35=J 34=2 49=TEST 52=20151008-06:04:04.158 56=BAOBAB 6=9.175 15=ZAR 22=4 48=ZAE0007990962 53=506 54=1 55=R 60=20151008-08:04:04.141 64=20151008 70=080404139 71=0 75=20151008 106=ABC 118=4642.56 207=XJSE 381=4642.56 626=2 857=1 73=1 11=18122977 37=118 38=506 10=251 
20151008-06:04:10.876 : 8=FIX.4.4 9=110 35=j 34=2 49=BAOBAB 52=20151008-06:04:10.876 56=TEST 45=2 58=Conditionally Required Field Missing 372=J 380=5 10=127 
20151008-06:04:34.890 : 8=FIX.4.4 9=53 35=0 34=3 49=TEST 52=20151008-06:04:34.890 56=BAOBAB 10=176 
20151008-06:04:40.894 : 8=FIX.4.4 9=53 35=0 34=3 49=BAOBAB 52=20151008-06:04:40.894 56=TEST 10=177 
20151008-06:05:04.909 : 8=FIX.4.4 9=53 35=0 34=4 49=TEST 52=20151008-06:05:04.908 56=BAOBAB 10=175 
20151008-06:05:10.910 : 8=FIX.4.4 9=53 35=0 34=4 49=BAOBAB 52=20151008-06:05:10.910 56=TEST 10=165 
20151008-06:05:34.921 : 8=FIX.4.4 9=53 35=0 34=5 49=TEST 52=20151008-06:05:34.920 56=BAOBAB 10=173 
20151008-06:05:40.924 : 8=FIX.4.4 9=53 35=0 34=5 49=BAOBAB 52=20151008-06:05:40.924 56=TEST 10=174 

And finally, the acceptor settings:

[DEFAULT]
SenderCompID=BAOBAB
UseDataDictionary=N
StartTime=00:00:00
EndTime=00:00:00
FileStorePath=C:\Users\bernhard.haussermann\AppData\Local\Temp\FIX_BAOBAB
FileLogPath=C:\Users\bernhard.haussermann\AppData\Local\Temp\FIX_BAOBAB_log
ConnectionType=acceptor
SocketAcceptPort=8030
ResetOnLogon=N
ResetOnLogout=N
ResetOnDisconnect=N
[SESSION]
BeginString=FIX.4.4
TargetCompID=TEST
[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=FIX.5.0
TargetCompID=TEST

The C# code above is based on the example on the QuickFIX/n site.

Any ideas?

5
  • Can I see the message (preferably from your message log rather than a print statement)? Seeing your config might also be helpful. Commented Oct 6, 2015 at 13:58
  • The message log file ClientHandlerThread-0-Debug.messages.current.log remains empty. Commented Oct 7, 2015 at 4:32
  • There should be another log file. Make sure you are using a FileLogFactory and not a ScreenLogFactory. Commented Oct 7, 2015 at 14:20
  • Thanks. I found it and added the log. Commented Oct 8, 2015 at 6:13
  • I added the acceptor settings string. Commented Oct 8, 2015 at 7:46

1 Answer 1

6

After downloading the source code for quickfix/n and debugging against it I finally found the cause of the problem!

The acceptor did not interpret the message properly because it did not create a group for the NoOrders (73) tag. The data-dictionary map for looking up group tags was empty, because I used UseDataDictionary=N in my settings. Changing the acceptor to use a data dictionary solved the problem.

Here is my updated settings string:

[DEFAULT]
SenderCompID=BAOBAB
UseDataDictionary=Y
DataDictionary=C:\Users\bernhard.haussermann\AppData\Local\Temp\FIX44.xml
StartTime=00:00:00
EndTime=00:00:00
FileStorePath=C:\Users\bernhard.haussermann\AppData\Local\Temp\FIX_BAOBAB
FileLogPath=C:\Users\bernhard.haussermann\AppData\Local\Temp\FIX_BAOBAB_log
ConnectionType=acceptor
SocketAcceptPort=8030
ResetOnLogon=N
ResetOnLogout=N
ResetOnDisconnect=N
[SESSION]
BeginString=FIX.4.4
TargetCompID=TEST
Sign up to request clarification or add additional context in comments.

1 Comment

Good catch. Failing to specify UseDataDictionary=Y is a common mistake, and was one reason I asked for your config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.