0

I'm using the QuickFix .Net Dll to receive and process TradeCaptureReport messages. I have been sent a TradeCaptureReport message that contains a few custom fields.

I'm able to pull some values from the message using the various get*() methods, however, when I try to use the getGroup(...) method, I get a FieldNotFound Exception.

var msg = new QuickFix44.TradeCaptureReport();
msg.setString(@"8=FIX.4.49=52435=AE...");
var noSides = new QuickFix44.TradeCaptureReport.NoSides();
msg.getGroup(1, noSides);

Could this be caused by the existence of the custom fields? which coincidentally show up just before the repeating group I'm trying to read? If so how best to alter the Data Dictionary in the FIX44.xml file?

Also, in in the Message.GetGroup(uint num, Group g)

what does the parameter num mean? all examples found http://www.quickfixengine.org/quickfix/doc/html/repeating_groups.html imply it's nth instance of the group you're looking for, but if someone could confirm i'd appreciate it.

Edit Thanks for the comments/answers

I'm confused about the group... using has group returns false

        var noSides = new QuickFix44.TradeCaptureReport.NoSides();
        var p = msg.hasGroup(noSides);

but my message clearly has a 552 tag, and when i do

        var q = msg.getNoSides();

It returns a QuickFix.NoSides with a value of 1.

Entire Message is as follows. 8=FIX.4.49=52435=AE49=ICE34=4052=20130213-14:44:57.37756=922257=42571=69487=0856=0828=0150=F17=1300946539=2570=N55=21914748=BRN FMH0013!22=8461=FXXXXX916=20130301917=2013033132=26.031=12.09018=269022=175=2013021360=20130213-14:44:57.3759413=0552=154=237=1300955611=170339730453=7448=someTrader447=D452=11448=SomePartyIdFirm447=D452=13448=9222447=D452=56448=8558447=D452=4448=SomePartyId1447=D452=51448=SomePartyId2447=D452=60448=U447=D452=5410=252

thanks.

priehl
  • 644
  • 2
  • 9
  • 21
  • Why are you using msg.setString and not using the standard MessageCracker convention? – Grant Birchmeier Feb 14 '13 at 00:00
  • I'm simply trying to recreate the arrival of a message. Does this achieve that? – priehl Feb 14 '13 at 14:44
  • Use the `Message(string)` constructor instead. If you put in some logic to identify the message type (e.g. ExecutionReport), you can use more-specific constructors like `ExecutionReport(string)`. See [this question](http://stackoverflow.com/questions/14622258/using-quickfix-n-to-read-a-fix-log-file/14628657), as it looks like it's from someone doing the same thing you're doing. – Grant Birchmeier Feb 14 '13 at 15:23
  • Weird, there is no constructor for QuickFix44.TradeCaptureReport that takes a message. Are you saying that there is no way to recreate a trade capture report equivalent to the one that was sent to me, based on the string that was saved to my log files? – priehl Feb 14 '13 at 16:16
  • Oops, I messed up. The more-specific constructor is `TradeCaptureReport(Message)`. You create the Message with the string constructor, then feed that Message to the TCR constructor. – Grant Birchmeier Feb 14 '13 at 16:26
  • the only constructors for TCR are `public TradeCaptureReport(); public TradeCaptureReport(TradeReportID aTradeReportID, PreviouslyReported aPreviouslyReported, LastQty aLastQty, LastPx aLastPx, TradeDate aTradeDate, TransactTime aTransactTime);` – priehl Feb 14 '13 at 16:49
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/24527/discussion-between-grant-birchmeier-and-priehl) – Grant Birchmeier Feb 14 '13 at 16:58

1 Answers1

1
msg.getGroup(1, noSides)

Before doing this, check if there are any groups or confirm the number of groups or if the number of sides field is set or has a value greater than 0, where relevant. Else how do you know how many groups to extract.

Could this be caused by the existence of the custom fields? 

Not necessarily

Message.GetGroup(uint num, Group g)

num is the num-th group in the FIX message of the type Group.

DumbCoder
  • 5,696
  • 3
  • 29
  • 40