How to correctly set NoSides and Side in TradeCaptureReport?

51 Views Asked by At

I am using the latest version of Quickfix to simulate sending a TradeCaptureReport. To do that, I set the values of the mandatory component noSides and Sides. When I do that, I get an error saying

......22458=Incorrect NumInGroup count for repeating group, field=....

Unfortunately, the answer to this question : How to correctly set groups in TradeCaptureReport? and the examples within the library are made in 4.4 and so do not apply in my case.

TradeCaptureReport tradeCaptureReport = new TradeCaptureReport();
Instrument instrument = new Instrument();
instrument.set(new Symbol("XXX"));//55
instrument.set(new SecurityID("XXXXXX")); //48

TrdCapRptSideGrp trdCapRptSideGrp =new TrdCapRptSideGrp();
 // Create and add the NoSides group with the individual sides of the trade
NoSides noSides = new NoSides();
noSides.setValue(NoSides.ONE_SIDE);
trdCapRptSideGrp.set(noSides);
trdCapRptSideGrp.setField(new Side(Side.BUY));
tradeCaptureReport.set(new LastPx(123456));
tradeCaptureReport.set(new LastQty(1234));
tradeCaptureReport.set(new SettlDate("20231018"));
tradeCaptureReport.set(instrument);
tradeCaptureReport.set(trdCapRptSideGrp);
0

There are 0 best solutions below