{{Quickfixn}} Adding a custom group to NewOrderSingle

Grant Birchmeier gbirchmeier at connamara.com
Mon Sep 14 08:25:58 PDT 2015


Ah, now I see the problem.  You're misunderstanding the Group constructor's
parameters.  Furthermore, I think you ought to use the three-param version,
to make sure the group is always generated with same internal field order.

I *think* you want this:
    var legsGroup = new Group(555,54,[54,second-tag,third-tag,etc]);
which is the same as:
    var legsGroup = new Group(Tags.NoLegs, Tags.Side,
[Tags.Side,second-tag,third-tag,etc]);

(I'm only guessing that Side is you're delimiter field, based on your
previous mails.)

Do NOT add field 555 separately.  The above should do that.  (This is where
the 1=1 and 2=1 was coming from; it was using your counter instead of 555.)

You should probably create a subclass of Group:

public class CustomNoLegsGroup : Group
{
    public static int [] fieldOrder = {Tags.Side, Tags.Whatever1,
Tags.Whatever2};

    public CustomNoLegsGroup()
      :base( Tags.NoLegs, Tags.Side, fieldOrder);
}


I stole the above from here (class NoLegsGroup within TradeCaptureReport):
https://github.com/connamara/quickfixn/blob/master/QuickFIXn/Message/FIX44/TradeCaptureReport.cs#L5785

With that custom group class, I think you can write code that looks more
similar to the tutorial example:
http://quickfixn.org/tutorial/repeating-groups.html



On Mon, Sep 14, 2015 at 8:44 AM, Damion Saunders <Damion.Saunders at sucfin.com
> wrote:

> Hi Grant
>
>
>
> I am confused by your comment that the top level order does not matter, as
> the fact that 555 is not followed by my repeating group is get “Repeating
> group fields out of order”.
>
>
>
> I understand your confusion over FIX.Delimiter as this is one of our
> classes and holds a value we use often i.e. the FIX delimiter. I only used
> it as the context help for group says its parameters are field and delim. I
> have changed it to use the int that stores the main field and that does not
> change anything. i.e.
>
>
>
>             const int SideField = 54;
>
> .........
>
> .........
>
> .........
>
>   var legsGroup = new Group(counter , SideField);
>
>                 legsGroup.SetField(new StringField(SideField,
>
>                                             legToAdd.Side == TradeSide.Buy
>
>                                             ?
> QuickFix.Fields.Side.BUY.ToString()
>
>                                             :
> QuickFix.Fields.Side.SELL.ToString()));
>
>
>
> The following is the fix it produces which is nearly correct but 555 must
> be followed by the NoLegs group and the 1=1, 2=1 parameters are not needed.
>
>
>
>
> 8=FIX.4.49=38335=D34=249=XXXXXXXX52=20150914-12:56:09.87956=XXX11=XXX12345678955=CAD75=20150907109=01657167=F375=XXX423=0555=25179=0123455478=15479=15681=06004=C7931=220011=01234520012=0000000XXXXXXXX6X3521=154=160=20150914-13:56:09.000687=45474=5118.55475=0212155476=088885477=CROSS2=154=260=20150914-13:56:09.000687=45474=5117.55475=0712155476=088885477=CROSS10=185
>
>
>
> Damion
>
> <http://www.sucdenfinancial.com/>www.sucdenfinancial.com
>
> Sucden Financial Limited, Plantation Place South, 60 Great Tower Street,
> London EC3R 5AZ
> Telephone +44 203 207 5000
>
> Registered in England no. 1095841
> VAT registration no. GB 446 9061 33
>
> Authorised and Regulated by the Financial Conduct Authority (FCA) and
> entered in the FCA register under no. 114239
>
> This email, including any files transmitted with it, is confidential and
> may be privileged. It may be read, copied and used only by the intended
> recipient. If you are not the intended recipient of this message, please
> notify *postmaster at sucfin.com <postmaster at sucfin.com>* immediately and
> delete it from your computer system.
>
> We believe, but do not warrant, that this email and its attachments are
> virus-free, but you should check.
>
>
>
> Sucden Financial Limited may monitor traffic data of both business and
> personal emails. By replying to this email, you consent to Sucden Financial
> 's monitoring the content of any emails you send to or receive from Sucden
> Financial . Sucden Financial is not liable for any opinions expressed by
> the sender where this is a non-business email.
>
>
>
> The contents of this e-mail do not constitute advice and should not be
> regarded as a recommendation to buy, sell or otherwise deal with any
> particular investment.
>
>
>
> This message has been scanned for viruses by Mimecast
> <http://www.mimecast.com/>
>
> _______________________________________________
> Quickfixn mailing list
> Quickfixn at lists.quickfixn.com
> http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com
>
>


-- 
Grant Birchmeier
*Connamara Systems, LLC*
*Made-To-Measure Trading Solutions.*
Exactly what you need. No more. No less.
http://connamara.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20150914/b96d4798/attachment-0002.htm>


More information about the Quickfixn mailing list