Re: [Quickfix-users] user defined types seems to break typesafe cracking in C++
Brought to you by:
orenmnero
From: Oren M. <or...@qu...> - 2006-04-17 16:25:22
|
Richard, I re-read your original post and seems like I misread it. I thought you were having trouble when you were including the LegSymbol, now I see you are actually having trouble when you do not include it. Despite what the fiximate says in the spec, in this case LegSymbol is absolutely necessary. It is a general rule in the FIX specification that for every repeating group, the first field of that group is always required. Why? Because that field is the delimiter which determines when a new group starts (FIX does not have a special delimiter field). For this reason, if you do not include the LegSymbol, QuickFIX is not given enough information to parse the message, and therefore the checksum is incorrect. A better error message should be given when a message fails validation for this reason, however it is the case that the message is incorrect without those fields. --oren Murphy, Richard wrote: >QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html >QuickFIX Support: http://www.quickfixengine.org/services.html > >It'll take me a bit of time to reformat the ouput but here's the code >which creates both a quote request either with or with out the LegSymbol >- depending on the arg. > >Cheers >R > >int requestId = 1000000; > >FIX44::QuoteRequest TestFIX::makeQuoterequest( bool legSymbol ) >{ > char psId[20]=""; > sprintf( psId,"%i", ++requestId); > > FIX::QuoteReqID quoteRequestID( psId ); > FIX44::QuoteRequest msg ( quoteRequestID ); > > msg.set(FIX::NoRelatedSym(1)); > > FIX44::QuoteRequest::NoRelatedSym noRelatedSym; > noRelatedSym.set (FIX::Symbol (".STOXX50E")); > noRelatedSym.set (FIX::OrderQty (1)); > noRelatedSym.set (FIX::SecurityType("MLEG")); > noRelatedSym.set (FIX::QuoteType(0)); > noRelatedSym.set (FIX::Account ("CANTOR")); > > FIX::NoUnderlyings underlying(1); > noRelatedSym.set( underlying ); > FIX44::QuoteRequest::NoRelatedSym::NoUnderlyings ugroup; > ugroup.set( FIX::UnderlyingSymbol(".STOXX50E")); > ugroup.set( FIX::UnderlyingPx( 3800 )); > noRelatedSym.addGroup( ugroup ); > > > std::string optionSymbol( "STXE38000E6.EX"); > FIX44::QuoteRequest::NoRelatedSym::NoLegs fixLeg; > if ( legSymbol ) > fixLeg.set (FIX::LegSymbol ( optionSymbol )); > fixLeg.set (FIX::LegSide ('1')); // 1=buy > fixLeg.set (FIX::LegMaturityMonthYear( "2006-05") ); > fixLeg.set (FIX::LegStrikePrice( 3800 )); > fixLeg.set (FIX::LegRatioQty( 1 )); > fixLeg.set (FIX::LegCFICode("OCE")); > fixLeg.set (FIX::LegContractMultiplier(10)); > noRelatedSym.addGroup( fixLeg ); > > FIX44::QuoteRequest::NoRelatedSym::NoLegs fixLeg2; > if ( legSymbol ) > fixLeg2.set (FIX::LegSymbol( "STXE38000Q6.EX")); > fixLeg2.set (FIX::LegSide ('2')); // 1=buy > fixLeg2.set (FIX::LegMaturityMonthYear( "2006-05") ); > fixLeg2.set (FIX::LegStrikePrice( 3800 )); > FIX::LegRatioQty ratio(1); > fixLeg2.set (FIX::LegRatioQty( ratio )); > fixLeg2.set (FIX::LegCFICode("OPE")); > fixLeg2.set( FIX::LegContractMultiplier(10)); > > noRelatedSym.addGroup( fixLeg2 ); > > msg.addGroup( noRelatedSym ); > return msg; > >} > > > >-----Original Message----- >From: Oren Miller [mailto:or...@qu...] >Sent: 13 April 2006 17:25 >To: Murphy, Richard >Cc: qui...@li... >Subject: Re: [Quickfix-users] user defined types seems to break typesafe >cracking in C++ > >These messages don't have any SOH or any other ASCII character >representing an SOH. This makes it difficult to work with. Could you >repost with the messages with some sort of delimiter between the fields? > >Also if you can post the code which generated the messages, that would >be helpful as well. > >--oren > >Murphy, Richard wrote: > > > >>Oren, >> >>I've attached a file. The first line is the fix msg with the legsymbol >>the second is the msg without the legsymbol (id=600). >> >>Fyi my current workaround is to comment out the checksym check in >>Message.cpp and rebuild quickfix. >> >>Thanks, >>Richard. >> >> >>-----Original Message----- >>From: Oren Miller [mailto:or...@qu...] >>Sent: 13 April 2006 15:32 >>To: Murphy, Richard >>Cc: qui...@li... >>Subject: Re: [Quickfix-users] user defined types seems to break >> >> >typesafe > > >>cracking in C++ >> >>Richard, >> >>Can you post your actual messages (with and without the LegSymbol)? >> >>--oren >> >>Murphy, Richard wrote: >> >> >> >> >> >>>Oren, >>> >>>I've found that the checksum is failing if I do not include LegSymbol >>>in a QuoteRequest. >>> >>>Line 564 of Message.cpp (v 1.10.2) >>> >>>"Expected CheckSum=128, Recieved CheckSum=129" >>> >>>However this text doesn't seem to get logged in any of output text >>>files - had todebug it. >>> >>>I've not figured out why the checksum fails. >>> >>>R >>> >>>* From: * Murphy, Richard >>>*Sent:* 12 April 2006 19:02 >>>*To:* Oren Miller; qui...@li... >>>*Subject:* RE: [Quickfix-users] user defined types seems to break >>>typesafe cracking in C++ >>> >>>I've tried debugging quickfix source >>> >>>I've run into a similar symptom which is that if I send an quote >>>request whose InstrumentLeg has not LegSymbol then it seems to >>>persistently break quickfix. >>> >>>Ie unless I delete seqnum file the communication is broken. I notice >>>that FIX::Session::verify never gets called but the msg is logged to >>>FIX.4.4.XXXXX.incoming. >>> >>>If I add the LegSymbol field then everything works (it's not a >>>required field in 4.4) - aha that's it it is a required symbol in >>>FIX4.4.xml but not according to >>> >>>http://www.fixprotocol.org/specifications/fix4.4fiximate/index.html >>> >>>I tried setting LegSymbol to not requied in the fix44.xml but that >>>didn't have any effect. >>> >>>Any ideas what is going on ? >>> >>>Thanks >>> >>>R >>> >>>* From: * Oren Miller [mailto:or...@qu...] >>>*Sent:* 03 April 2006 15:58 >>>*To:* Murphy, Richard; qui...@li... >>>*Subject:* Re: [Quickfix-users] user defined types seems to break >>>typesafe cracking in C++ >>> >>>Have you tried tracing through the message cracker? There shouldn't be >>> >>> >>> >>> >> >> >> >> >>>any reason why adding a field would cause the behavior to change. >>> >>>--oren >>> >>> ----- Original Message ----- >>> >>> * From: * Murphy, Richard <mailto:Ric...@ci...> >>> >>> * To: * qui...@li... >>> <mailto:qui...@li...> >>> >>> * Sent: * Friday, March 31, 2006 5:59 AM >>> >>> * Subject: * [Quickfix-users] user defined types seems to break >>> typesafe cracking in C++ >>> >>> Hi, >>> >>> I'm looking at QuickFix user defined types. >>> >>> I find that if I add a user defined field to a structure such as a >>> FIX44::Quote I find that typesafe message cracking fails. >>> >>> What I mean by that is that the the onMessage function that takes >>> FIX44::Quote as an argument does not get called. >>> >>> If I remove the user defined type then the function does get >>> >>> >>> >>> >>called. >> >> >> >> >>> Can you confirm this behaviour ? Is there a workaround ? >>> >>> I used the procedure documented on the QuickFix doc url. >>> >>> Thanks >>> >>> Richard. >>> >>> QuickFix Version 1.10.2 >>> >>> Compiler : g++ (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-42) >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>----------------------------------------------------------------------- >> >> >- > > >>--------------------- >> >> >> >> >>> The information contained in this transmission and any attached >>> documents is privileged, confidential and intended only for the >>> use of the individual or entity named above. If the reader of this >>> message is not the intended recipient, you are hereby directed not >>> to read the contents of this transmission, and are hereby notified >>> that any disclosure, copying, distribution, dissemination or use >>> of the contents of this transmission, including any attachments, >>> or the taking of any action in reliance thereon, is strictly >>> prohibited. If you have received this communication in error, >>> please notify the sender and/or Citadel Investment Group ( Europe >>> ) Ltd immediately by telephone at +44 (0) 20 7645 9700 and destroy >>> any copy of this transmission. >>> >>> Citadel Investment Group ( Europe ) Ltd is authorised and >>> regulated by the Financial Services Authority (FSA Firm Ref No >>> 190260). >>> Registered in England . Registration No. 3666898. >>> Registered Office: 10th Floor, 2 George Yard, Lombard Street , >>> London EC3V 9DH >>> >>> >>> >>> >>> >> >>----------------------------------------------------------------------- >> >> >---------------------- > > >>The information contained in this transmission and any attached >> >> >documents is privileged, confidential and intended only for the use of >the individual or entity named above. If the reader of this message is >not the intended recipient, you are hereby directed not to read the >contents of this transmission, and are hereby notified that any >disclosure, copying, distribution, dissemination or use of the contents >of this transmission, including any attachments, or the taking of any >action in reliance thereon, is strictly prohibited. If you have >received this communication in error, please notify the sender and/or >Citadel Investment Group (Europe) Ltd immediately by telephone at +44 >(0) 20 7645 9700 and destroy any copy of this transmission. > > >>Citadel Investment Group (Europe) Ltd is authorised and regulated by >> >> >the Financial Services Authority (FSA Firm Ref No 190260). > > >>Registered in England. Registration No. 3666898. >>Registered Office: 10th Floor, 2 George Yard, Lombard Street, London >> >> >EC3V 9DH > > >> >> >>----------------------------------------------------------------------- >> >> >- > > >>8=FIX.4.49=29135=R34=3149=TESTFIX52=20060413-14:51:23.84656=ASRFQServer >> >> >131=1000001146=155=.STOXX50E167=MLEG537=038=11=CANTOR555=2600=STXE38000E >6.EX608=OCE610=2006-05612=3800614=10623=1624=1600=STXE38000Q6.EX608=OPE6 >10=2006-05612=3800614=10623=1624=2711=1311=.STOXX50E810=380010=105 > > >>8=FIX.4.49=25335=R34=4349=TESTFIX52=20060413-14:54:33.65756=ASRFQServer >> >> >131=1000003146=155=.STOXX50E167=MLEG537=038=11=CANTOR555=2608=OCE610=200 >6-05612=3800614=10623=1624=1608=OPE610=2006-05612=3800614=10623=1624=271 >1=1311=.STOXX50E810=380010=178 > > > > > > > >--------------------------------------------------------------------------------------------- > >The information contained in this transmission and any attached documents is privileged, confidential and intended only for the use of the individual or entity named above. If the reader of this message is not the intended recipient, you are hereby directed not to read the contents of this transmission, and are hereby notified that any disclosure, copying, distribution, dissemination or use of the contents of this transmission, including any attachments, or the taking of any action in reliance thereon, is strictly prohibited. If you have received this communication in error, please notify the sender and/or Citadel Investment Group (Europe) Ltd immediately by telephone at +44 (0) 20 7645 9700 and destroy any copy of this transmission. > >Citadel Investment Group (Europe) Ltd is authorised and regulated by the Financial Services Authority (FSA Firm Ref No 190260). >Registered in England. Registration No. 3666898. >Registered Office: 10th Floor, 2 George Yard, Lombard Street, London EC3V 9DH > > >------------------------------------------------------- >This SF.Net email is sponsored by xPML, a groundbreaking scripting language >that extends applications into web and mobile media. Attend the live webcast >and join the prime developer group breaking into this new coding territory! >http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 >_______________________________________________ >Quickfix-users mailing list >Qui...@li... >https://lists.sourceforge.net/lists/listinfo/quickfix-users > > > > |