Quantcast

Extracting Groups from MassQuote Request

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Extracting Groups from MassQuote Request

hias9
Hi everybody,

I am trying to extract groups and subgroups from a MassQuote request (FIX 4.4) using the latest version of QuickFIX/J.

The received MassQuote message looks like the following:
8=FIX.4.4 9=188 35=i 34=3 49=xxxx 52=20170213-00:00:12.345 56=xxxx 296=2 302=2 295=1 299=0 134=1000000 135=500000 188=1.24876 190=1.24886 302=3 295=1 299=0 134=1000000 135=1000000 188=1.0049 190=1.00496 10=248

So in this example 296=2 tells that 2 QuoteSet groups will follow:
1) 302=2 295=1 299=0 134=1000000 135=500000 188=1.24876 190=1.24886
2) 302=3 295=1 299=0 134=1000000 135=1000000 188=1.0049 190=1.00496

How can I extract those QuoteSet groups?

What I have tried was the following:

public void onMessage(quickfix.fix44.MassQuote message, SessionID sessionID)
      throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue {

        MassQuote.NoQuoteSets qsGroup = new MassQuote.NoQuoteSets();
        message.getGroup(1, qsGroup);

}

However "message.getGroup(1, qsGroup);" results in a "quickfix.FieldNotFound: 296" error message.

Thank you for any help you can provide.

Best Regards,
Matthias
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Extracting Groups from MassQuote Request

Christoph John
QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
QuickFIX/J Support: http://www.quickfixj.org/support/


Hi,

works for me:

         String msg = "8=FIX.4.4 9=188 35=i 34=3 49=xxxx 52=20170213-00:00:12.345 56=xxxx "

                 + "296=2 "

                 + "302=2 295=1 299=0 134=1000000 135=500000 188=1.24876 190=1.24886 "

                 + "302=3 295=1 299=0 134=1000000 135=1000000 188=1.0049 190=1.00496 10=152 ";

         quickfix.fix44.MassQuote massQuote = new quickfix.fix44.MassQuote();

         massQuote.fromString( msg.replaceAll( " ", "\001" ), new DataDictionary( "FIX44.xml" ), true );

         

         quickfix.fix44.MassQuote.NoQuoteSets qsGroup = new quickfix.fix44.MassQuote.NoQuoteSets();

         quickfix.fix44.MassQuote.NoQuoteSets group1 = ( quickfix.fix44.MassQuote.NoQuoteSets )massQuote.getGroup(1, qsGroup);

         System.out.println( "XXXX " + group1.getQuoteSetID() );

         quickfix.fix44.MassQuote.NoQuoteSets group2 = ( quickfix.fix44.MassQuote.NoQuoteSets )massQuote.getGroup(2, qsGroup);

         System.out.println( "XXXX " + group2.getQuoteSetID() );


Output:

XXXX 302=2

XXXX 302=3



Are you using a data dictionary with your session config? If not, then there might be problems
parsing repeating groups. Just test to log the message that you receive in your onMessage method.
Does it look differently than the message that you receive over the wire? If yes, then the problem
is most probably with the data dictionary.

Best regards,
Chris.



On 13/02/17 03:40, hias9 wrote:

> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
>
>
> Hi everybody,
>
> I am trying to extract groups and subgroups from a MassQuote request (FIX
> 4.4) using the latest version of QuickFIX/J.
>
> The received MassQuote message looks like the following:
> 8=FIX.4.4 9=188 35=i 34=3 49=xxxx 52=20170213-00:00:12.345 56=xxxx 296=2
> 302=2 295=1 299=0 134=1000000 135=500000 188=1.24876 190=1.24886 302=3 295=1
> 299=0 134=1000000 135=1000000 188=1.0049 190=1.00496 10=248
>
> So in this example 296=2 tells that 2 QuoteSet groups will follow:
> 1) 302=2 295=1 299=0 134=1000000 135=500000 188=1.24876 190=1.24886
> 2) 302=3 295=1 299=0 134=1000000 135=1000000 188=1.0049 190=1.00496
>
> How can I extract those QuoteSet groups?
>
> What I have tried was the following:
>
> public void onMessage(quickfix.fix44.MassQuote message, SessionID sessionID)
>        throws FieldNotFound, UnsupportedMessageType, IncorrectTagValue {
>
>          MassQuote.NoQuoteSets qsGroup = new MassQuote.NoQuoteSets();
>          message.getGroup(1, qsGroup);
>
> }
>
> However "message.getGroup(1, qsGroup);" results in a
> "quickfix.FieldNotFound: 296" error message.
>
> Thank you for any help you can provide.
>
> Best Regards,
> Matthias
>
>
>
> --
> View this message in context: http://quickfix-j.364392.n2.nabble.com/Extracting-Groups-from-MassQuote-Request-tp7579785.html
> Sent from the QuickFIX/J mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Quickfixj-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users

--
Christoph John
Development & Support
Direct: +49 241 557080-28
Mailto:[hidden email]
       


http://www.macd.com <http://www.macd.com/>
----------------------------------------------------------------------------------------------------
       
----------------------------------------------------------------------------------------------------
MACD GmbH
Oppenhoffallee 103
D-52066 Aachen
Tel: +49 241 557080-0 | Fax: +49 241 557080-10
         Amtsgericht Aachen: HRB 8151
Ust.-Id: DE 813021663

Geschäftsführer: George Macdonald
----------------------------------------------------------------------------------------------------
       
----------------------------------------------------------------------------------------------------

take care of the environment - print only if necessary

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Quickfixj-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfixj-users
Loading...