Search code examples
pythonfix-protocol

FIX market data request issue - Incorrect NumInGroup count for repeating group


Im trying to get a market data by FIX protocol. This is what Im sending as a request:

8=FIX.4.4|9=120|35=V|34=2|49=icmarkets.3540639|52=20190917-05:55:39.114|56=CSERVER|262=2|263=1|264=0|265=0|269=0|146=1|55=EUR/USD|267=2|10=173

and this is the response received:

8=FIX.4.4|9=163|35=3|34=2|49=CSERVER|50=TRADE|52=20190917-05:55:39.142|56=icmarkets.3540639|45=2|58=Incorrect NumInGroup count for repeating group, field=267|371=267|372=V|373=16|10=216

So there is obviously an error Incorrect NumInGroup count for repeating group, field=267 but I have no idea how to fix this. Any tips?

Thanks!


Solution

  • Your tags are in a complete different order than they should be. Tag 267/NoMDEntryTypes is the count tag for the repeating group and should precede that repeating group. You send 267=2 at the end of the message. It really should be before tag 269/MdEntryType. 269 is the delimiter tag which marks the beginning of a new instance of that repeating group. But you only have one tag 269 (i.e. group count is only 1). That is probably the next problem that your counterparty will report.

    Please get the FIX rules of engagement of your counterparty to check what they expect. Maybe they even have some example messages in there.

    The order of tags outside of repeating groups is irrelevant. But the count and delimiter tag of a repeating group need to be in order.

    Edit: here is the common description of a MarketDataRequest per the FIX 4.4 spec: https://fiximate.fixtrading.org/legacy/en/FIX.4.4/body_505786.html But your counterparty might have slight differences.