|
From: stacyann_1 <sta...@gs...> - 2007-06-27 18:20:53
|
I'm having problems finding documentation to explain how to do this: The message that is being sent to me has multiple PartyId/PartyIdSource/PartyRole fields. For example: 448=3DSSNY=01447=3DD=01452=3D1=01448=3DSMARCASSOLI:4784543=01447=3DD=01452= =3D11=01 448=3DTEST, TEST & CO.=01447=3DD=01452=3D13=0110=3D192 How can I code to specifically retrieve the PartyId associated with PartyRole of 11? Thanks, Stacy --=20 View this message in context: http://www.nabble.com/Multiple-PartyId%27s-tf= 3990055.html#a11329821 Sent from the QuickFIX/J mailing list archive at Nabble.com. |
|
From: Toli K. <to...@ma...> - 2007-06-27 18:56:59
|
Stacy, Do you have a NoPartyIDs tag (453) somewhere in your message? If that's the case, you are looking at the Parties repeating group, and you can use the sample code form http://www.quickfixj.org/quickfixj/usermanual/usage/repeating_groups.html to see how to read data from repeating groups. Here's the link to the Parties block in the FIX4.4 spec: http://www.btobits.com/fixopaedia/fixdic44/bd0e-Parties.html You can also see the real-life examples of extracting repeating groups in the Marketcetera Platform code too: http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/main/java/org/marketcetera/quickfix/FIXValueExtractor.java#L31 and the corresponding test: http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/test/java/org/marketcetera/quickfix/FIXValueExtractorTest.java#L67 hope this helps On 6/27/07, stacyann_1 <sta...@gs...> wrote: > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ > QuickFIX/J Support: http://www.quickfixj.org/support/ > > I'm having problems finding documentation to explain how to do this: > > The message that is being sent to me has multiple > PartyId/PartyIdSource/PartyRole fields. For example: > 448=SSNY 447=D 452=1 448=SMARCASSOLI:4784543 447=D 452=11 > 448=TEST, TEST & CO. 447=D 452=13 10=192 > > How can I code to specifically retrieve the PartyId associated with > PartyRole of 11? > > Thanks, > Stacy > -- -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. |
|
From: stacyann_1 <sta...@gs...> - 2007-06-27 20:23:09
|
Thanks Toli. I had a couple of questions about that.. maybe you would know? The sample code goes like this NoMDEntries noMDEntries = new NoMDEntries(); message.get(noMDEntries); quickfix.fix42.MarketDataSnapshotFullRefresh.NoMDEntries group = new quickfix.fix42.MarketDataSnapshotFullRefresh.NoMDEntries(); How come noMDEntries is defined as NoMDEntries but group is defined as quickfix.fix42.MarketDataSnapshotFullRefresh.NoMDEntries? Does it need to be this way? Also is the above message defined as a Message? Mine is also, but 'get' is not a valid method. I was previously using getField, but I'm not sure that is correct here. I was hoping I could somehow avoid iteration to see which PartId I care about, but it doesn't seem like that is possible. Thanks, Stacy toli wrote: > > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ > QuickFIX/J Support: http://www.quickfixj.org/support/ > Stacy, > > Do you have a NoPartyIDs tag (453) somewhere in your message? > If that's the case, you are looking at the Parties repeating group, > and you can use the sample code form > http://www.quickfixj.org/quickfixj/usermanual/usage/repeating_groups.html > to see how to read data from repeating groups. > > Here's the link to the Parties block in the FIX4.4 spec: > http://www.btobits.com/fixopaedia/fixdic44/bd0e-Parties.html > > You can also see the real-life examples of extracting repeating groups > in the Marketcetera Platform code too: > http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/main/java/org/marketcetera/quickfix/FIXValueExtractor.java#L31 > and the corresponding test: > http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/test/java/org/marketcetera/quickfix/FIXValueExtractorTest.java#L67 > > hope this helps > > On 6/27/07, stacyann_1 <sta...@gs...> wrote: >> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ >> QuickFIX/J Support: http://www.quickfixj.org/support/ >> >> I'm having problems finding documentation to explain how to do this: >> >> The message that is being sent to me has multiple >> PartyId/PartyIdSource/PartyRole fields. For example: >> 448=SSNY 447=D 452=1 448=SMARCASSOLI:4784543 447=D 452=11 >> 448=TEST, TEST & CO. 447=D 452=13 10=192 >> >> How can I code to specifically retrieve the PartyId associated with >> PartyRole of 11? >> >> Thanks, >> Stacy >> -- > > > -- > Toli Kuznets > http://www.marketcetera.com: Open-Source Trading Platform > download.run.trade. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Quickfixj-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfixj-users > > -- View this message in context: http://www.nabble.com/Multiple-PartyId%27s-tf3990055.html#a11331862 Sent from the QuickFIX/J mailing list archive at Nabble.com. |
|
From: Toli K. <to...@ma...> - 2007-06-27 21:06:45
|
Stacy, I think you are seeing problems because you are using a general quickfix.Message instead of a specific fix-versioned message such as quickfix.fix44.ExecutionReport The reason you are not seeing message.get() functions is that they don't exist in a general quickfix.Message but do exist (with only specific parameter types) in a more concrete quickfix.fix4x.<MessageType> classes. > How come noMDEntries is defined as NoMDEntries but group is defined as > quickfix.fix42.MarketDataSnapshotFullRefresh.NoMDEntries? Does it need to be > this way? The first is NoMDEntries field that tells you the # of groups. the 2nd one is a concrete fix-versioned type for the group itself. So to answer your question - yes, you need to be more specific with your types if you want to just use get() methods. We solved that problem by creating a general -purpose fix-extractor methods (that work both on groups and regular messages) and just rely on the incoming type to get the right value out. Marketcetera Trading Platform is open-sourced and GPL'd, so depending on what you are doing with your code you may just be able to use the marketcetera-core jar file to reuse our code "for free": http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/main/java/org/marketcetera/quickfix/FIXValueExtractor.java > I was hoping I could somehow avoid iteration to see which PartId I care > about, but it doesn't seem like that is possible. I'm afraid not - you have to loop through them, i don't think there's a defined pattern to how the groups are arranged. -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. > |
|
From: stacyann_1 <sta...@gs...> - 2007-06-28 14:37:47
|
Thanks Toli -
I'm now getting an exception, so maybe I still don't completely grasp this.
Here is a snippet:
NoPartyIDs noPartyIDs = new NoPartyIDs();
quickFixMessage_.getField(noPartyIDs);
quickfix.fix44.ExecutionReport.NoPartyIDs group =
new quickfix.fix44.ExecutionReport.NoPartyIDs();
int i=1;
boolean traderFound = false;
PartyID partyId = new PartyID();
PartyRole partyRole = new PartyRole();
while (i <= noPartyIDs.getValue() && !traderFound) {
quickFixMessage_.getGroup(i, group);
group.get(partyId);
group.get(partyRole);
if (partyRole.getValue() == 1) {
traderFound = true;
}
}
The exception is
quickfix.FieldNotFound: 453, index=1
at quickfix.FieldMap.getGroup(FieldMap.java:621)
at the getGroup line.. I must still not be doing something right.
Thanks,Stacy
toli wrote:
>
> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
> Stacy,
>
> I think you are seeing problems because you are using a general
> quickfix.Message instead of a specific fix-versioned message such as
> quickfix.fix44.ExecutionReport
>
> The reason you are not seeing message.get() functions is that they
> don't exist in a general quickfix.Message but do exist (with only
> specific parameter types) in a more concrete
> quickfix.fix4x.<MessageType> classes.
>
>> How come noMDEntries is defined as NoMDEntries but group is defined as
>> quickfix.fix42.MarketDataSnapshotFullRefresh.NoMDEntries? Does it need to
>> be
>> this way?
> The first is NoMDEntries field that tells you the # of groups. the 2nd
> one is a concrete fix-versioned type for the group itself.
> So to answer your question - yes, you need to be more specific with
> your types if you want to just use get() methods.
>
> We solved that problem by creating a general -purpose fix-extractor
> methods (that work both on groups and regular messages) and just rely
> on the incoming type to get the right value out.
> Marketcetera Trading Platform is open-sourced and GPL'd, so depending
> on what you are doing with your code you may just be able to use the
> marketcetera-core jar file to reuse our code "for free":
> http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/main/java/org/marketcetera/quickfix/FIXValueExtractor.java
>
>> I was hoping I could somehow avoid iteration to see which PartId I care
>> about, but it doesn't seem like that is possible.
>
> I'm afraid not - you have to loop through them, i don't think there's
> a defined pattern to how the groups are arranged.
>
> --
> Toli Kuznets
> http://www.marketcetera.com: Open-Source Trading Platform
> download.run.trade.
>>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Quickfixj-users mailing list
> Qui...@li...
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>
>
--
View this message in context: http://www.nabble.com/Multiple-PartyId%27s-tf3990055.html#a11344136
Sent from the QuickFIX/J mailing list archive at Nabble.com.
|
|
From: Toli K. <to...@ma...> - 2007-06-28 19:32:51
|
That's very strange.
I shoved this unit test into the MessageTest class in the source code,
and stepped through with a debugger.
Seems to work for me. Maybe there's something wrong with your incoming message?
/**
* 448=SSNY 447=D 452=1 448=SMARCASSOLI:4784543 447=D 452=11
448=TEST, TEST & CO. 447=D 452=13 10=192
*/
public void testStacyAnn() throws Exception {
Message msg = new Message();
quickfix.fix44.ExecutionReport.NoPartyIDs group =
new quickfix.fix44.ExecutionReport.NoPartyIDs();
group.setString(448, "SSNY");
group.setString(447, "D");
group.setString(452, "1");
msg.addGroup(group);
group.setString(448, "SMARCASSOLI:4784543");
group.setString(447, "D");
group.setString(452, "11");
msg.addGroup(group);
group.setString(448, "TEST, TEST & CO.");
group.setString(447, "D");
group.setString(452, "13");
msg.addGroup(group);
// try to read out
quickfix.field.NoPartyIDs noPartyIDs = new quickfix.field.NoPartyIDs();
msg.getField(noPartyIDs);
int i=1;
boolean traderFound = false;
PartyID partyId = new PartyID();
PartyRole partyRole = new PartyRole();
while (i <= noPartyIDs.getValue() && !traderFound) {
msg.getGroup(i, group);
group.get(partyId);
group.get(partyRole);
if (partyRole.getValue() == 1) {
traderFound = true;
}
}
assertTrue(traderFound);
}
On 6/28/07, stacyann_1 <sta...@gs...> wrote:
> QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> QuickFIX/J Support: http://www.quickfixj.org/support/
>
> Thanks Toli -
> I'm now getting an exception, so maybe I still don't completely grasp this.
> Here is a snippet:
>
> NoPartyIDs noPartyIDs = new NoPartyIDs();
> quickFixMessage_.getField(noPartyIDs);
>
> quickfix.fix44.ExecutionReport.NoPartyIDs group =
> new quickfix.fix44.ExecutionReport.NoPartyIDs();
>
> int i=1;
> boolean traderFound = false;
> PartyID partyId = new PartyID();
> PartyRole partyRole = new PartyRole();
> while (i <= noPartyIDs.getValue() && !traderFound) {
> quickFixMessage_.getGroup(i, group);
> group.get(partyId);
> group.get(partyRole);
>
> if (partyRole.getValue() == 1) {
> traderFound = true;
> }
> }
>
>
> The exception is
> quickfix.FieldNotFound: 453, index=1
> at quickfix.FieldMap.getGroup(FieldMap.java:621)
>
> at the getGroup line.. I must still not be doing something right.
>
> Thanks,Stacy
>
> toli wrote:
> >
> > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
> > QuickFIX/J Support: http://www.quickfixj.org/support/
> > Stacy,
> >
> > I think you are seeing problems because you are using a general
> > quickfix.Message instead of a specific fix-versioned message such as
> > quickfix.fix44.ExecutionReport
> >
> > The reason you are not seeing message.get() functions is that they
> > don't exist in a general quickfix.Message but do exist (with only
> > specific parameter types) in a more concrete
> > quickfix.fix4x.<MessageType> classes.
> >
> >> How come noMDEntries is defined as NoMDEntries but group is defined as
> >> quickfix.fix42.MarketDataSnapshotFullRefresh.NoMDEntries? Does it need to
> >> be
> >> this way?
> > The first is NoMDEntries field that tells you the # of groups. the 2nd
> > one is a concrete fix-versioned type for the group itself.
> > So to answer your question - yes, you need to be more specific with
> > your types if you want to just use get() methods.
> >
> > We solved that problem by creating a general -purpose fix-extractor
> > methods (that work both on groups and regular messages) and just rely
> > on the incoming type to get the right value out.
> > Marketcetera Trading Platform is open-sourced and GPL'd, so depending
> > on what you are doing with your code you may just be able to use the
> > marketcetera-core jar file to reuse our code "for free":
> > http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/main/java/org/marketcetera/quickfix/FIXValueExtractor.java
> >
> >> I was hoping I could somehow avoid iteration to see which PartId I care
> >> about, but it doesn't seem like that is possible.
> >
> > I'm afraid not - you have to loop through them, i don't think there's
> > a defined pattern to how the groups are arranged.
> >
> > --
> > Toli Kuznets
> > http://www.marketcetera.com: Open-Source Trading Platform
> > download.run.trade.
> >>
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by DB2 Express
> > Download DB2 Express C - the FREE version of DB2 express and take
> > control of your XML. No limits. Just data. Click to get it now.
> > http://sourceforge.net/powerbar/db2/
> > _______________________________________________
> > Quickfixj-users mailing list
> > Qui...@li...
> > https://lists.sourceforge.net/lists/listinfo/quickfixj-users
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Multiple-PartyId%27s-tf3990055.html#a11344136
> Sent from the QuickFIX/J mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Quickfixj-users mailing list
> Qui...@li...
> https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>
--
Toli Kuznets
http://www.marketcetera.com: Open-Source Trading Platform
download.run.trade.
|
|
From: kp1983 <pal...@gm...> - 2010-11-04 16:51:09
|
Hello,
Even i have the same problem as Stacy had. I am getting an exception.
FieldNotFound : 453, index=1
below is my code snippet.
quickfix.fix44.TradeCaptureReport.NoSides.NoPartyIDs nopartyids = new
quickfix.fix44.TradeCaptureReport.NoSides.NoPartyIDs();
noPartyID = message.getNoPartyIDs.getValue();
int i=1;
if(i<=noPartyID)
{
message.getGroup(i,nopartyids);
partyid = nopartyids.getPartyID().getValue();
partyIDSource = nopartyids.getPartyIDSource().getValue();
partyRole = nopartyids.getPartyRole().getValue();
i++;
}
But it gives me exception at message.getGroup(i,nopartyids);
Kunal
--
View this message in context: http://quickfix-j.364392.n2.nabble.com/Multiple-PartyId-s-tp364798p5706043.html
Sent from the QuickFIX/J mailing list archive at Nabble.com.
|