Re: [Quickfix-users] Using NewOrderMultileg to send a two legged Order
Brought to you by:
orenmnero
From: Grant B. <gbi...@co...> - 2010-06-29 17:42:13
|
I see where you're having trouble. Many of the QF fields and components are actually from code that is generated from the info specified in an XML file. For FIX 4.3, the file is spec/FIX43.xml (this directory also contains the generator script). The generated items are not described in the online docs, but it looks like they are in the source release and probably in the binaries. You can find the source for such classes in src/C++/. To your question: You should be able to create a FIX43::NewOrderMultileg::NoLegs group, which derives from FIX::Group. The CustomerOrFirm field was removed from FIX 4.3; if your counterparty is using it anyway, then you'll need to edit the FIX43.xml file and regenerate/rebuild some source. Because most brokers take massive liberties with the FIX specs (such as adding custom fields and putting existing fields in messages they don't normally belong in), you usually have to tailor the xml file to their system and regenerate. I'm disappointed to see that this isn't really covered in the C++ QF docs. (In QuickFIX/J, the Java version, this is a standard part of the build process.) There are multiple spec/generate.* scripts for different OSs; I think all you need to do is run the script and rebuild the binaries. -Grant On Tue, Jun 29, 2010 at 11:33 AM, Fix User <fi...@ym...> wrote: > Dear Grant, > > > > Thanks much for your reply, and thanks for your suggestions and pointing > out the problems with my code. > > > > I've looked at the documentation, including the ones for repeating groups. > However, since the message type given in the example is different from my > usage (MarketDataSnapShotFullRefresh vs NewOrderMultileg) I'm still not > quite clear which data structure is to be used for each leg. > > > > I've tried using FIX::Group, but I was not clear (even after looking at the > 4.3 spec for repeating groups) to me if that's the correct one to use. > > > > Listed below is the code I came up with. Could you pls see if this is the > correct way to do it ? Btw, Group does not have a "set" method so I had to > use "setField". > > > > I really appreciate your help. > > > > Thank you. > > > > Jim > > > > ------------ code ------------ > > > > FIX43::NewOrderMultileg newOrder; > > > > newOrder.getHeader().set(FIX::TargetCompID("IB")); > > newOrder.getHeader().set(FIX::SenderCompID("direc314")); > > newOrder.getHeader().set(FIX::MsgType("AB")); > > newOrder.set(FIX::SecurityType("MLEG")); > > > > newOrder.set(FIX::TimeInForce(FIX::TimeInForce_DAY)); > > newOrder.set(FIX::SecurityExchange( > > "GLOBEX")); > > > > //CustomOrFirm, required for options > > newOrder.set(FIX::CustomerOrFirm(FIX::CustomerOrFirm(0)); //This does not > compile > > > > > > FIX::Group group1(1,1); //Not sure what the correct values for the > constructor. > > > > //First leg > > group1.setField(FIX::Symbol("ES")); > > group1.setField(FIX::Account("U00314")); > > group1.setField(FIX::LegSymbol("IB")); > > group1.setField(FIX::LegCFICode("OCF")); > > group1.setField(FIX::LegMaturityMonthYear("201007")); > > group1.setField(FIX::LegStrikePrice(1100)); > > group1.setField(FIX::LegRatioQty(1)); > > group1.setField(FIX::LegSide('1')); > > group1.setField(FIX::LegPositionEffect('O')); > > newOrder.addGroup(group1); > > ________________________________ > From: Grant Birchmeier <gbi...@co...> > Cc: qui...@li... > Sent: Tue, June 29, 2010 9:05:36 AM > Subject: Re: [Quickfix-users] Using NewOrderMultileg to send a two legged > Order > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Please review the "repeating groups" section of the quickfix docs, > because you're not doing it quite right. > > Normal link (down at the moment): > http://www.quickfixengine.org/quickfix/doc/html/repeating_groups.html > Google cached link: > http://webcache.googleusercontent.com/search?q=cache:UgZU3jrmDu8J:www.quickfixengine.org/quickfix/doc/html/repeating_groups.html+quickfix+repeating+groups&cd=1&hl=en&ct=clnk&gl=us&client=opera > > Furthermore, it's not recommended to use the "setField()" methods > directly. You should instead use the set() methods. See the "sending > messages" doc page, section titled "Most Type Safe... DO THIS!": > > Normal link (down at the moment): > http://www.quickfixj.org/quickfixj/usermanual/1.4.0/usage/sending_messages.html > Google cached link: > http://webcache.googleusercontent.com/search?q=cache:HCaHT_RRXacJ:www.quickfixengine.org/quickfix/doc/html/sending_messages.html+quickfix+sending+messages&cd=1&hl=en&ct=clnk&gl=us&client=opera > > > On Tue, Jun 29, 2010 at 7:13 AM, Fix User <fi...@ym...> wrote: >> QuickFIX Documentation: >> http://www.quickfixengine.org/quickfix/doc/html/index.html >> QuickFIX Support: http://www.quickfixengine.org/services.html >> >> >> Dear Fix Users, >> >> >> >> First, I tried to send this message to the list yesterday but I think it >> did not go thru. If you see multiple posts, I appologize. >> >> >> >> I'm a new QuickFix user. I'm trying to create a FIX43::NewOrderMultileg >> message to create a contract with two legs. Both legs are contracts on Emini >> (symbol "ES"). One leg is a future contract, and the second leg is an >> option on the future contract. >> >> >> >> >> >> My values are as follows: >> >> >> >> Common Values: >> >> ---------------------- >> >> >> >> FIX43::NewOrderMultileg newOrder; >> >> newOrder.getHeader().setField(FIX::TargetCompID("IB")); >> >> newOrder.getHeader().setField(FIX::SenderCompID("abcdef")); >> >> newOrder.getHeader().setField(FIX::MsgType("AB")); >> >> newOrder.setField(167, "MULTILEG"); >> >> newOrder.set(FIX::TimeInForce(FIX::TimeInForce_DAY)); >> >> newOrder.set(FIX::SecurityExchange( >> >> "GLOBEX")); >> >> newOrder.setField(204, >> >> "0"); //CustomOrFirm, required for options >> >> >> >> newOrder.setField(55, "ES"); //Symbol >> >> >> >> newOrder.setField(440, >> >> "AB12345"); //Account >> >> >> >> newOrder.setField(555, "2"); //No Legs >> >> >> >> //Values for Leg 1, Field and Value pairs for the Option Contract >> >> >> ---------------------------------------------------------------------------------- >> >> 600=>"ES" //Leg Symbol; >> >> 608=> "OCF" //LegCFICode >> >> 610=>"201007" //LegMaturity >> >> 612=>"1000" //LegStrikePrice >> >> 624=>"1" //LegSide >> >> >> >> Values for Leg 2, Field and Value pairs for the Future Contract >> >> >> -------------------------------------------------------------------------------- >> >> >> >> 600=>"ES" //Symbol >> >> 608=> "F" //LegCFICode >> >> 610=>"201009" //Leg Maturity >> >> 624=>"2" //LegSide >> >> >> >> >> >> Can someone pls show me how I can pass these leg1 and leg2 values into my >> NewOrderMultileg message ? I am using latest (C++) QuickFix. >> >> >> >> Thank you very much. >> >> >> >> Jim >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first >> _______________________________________________ >> Quickfix-users mailing list >> Qui...@li... >> https://lists.sourceforge.net/lists/listinfo/quickfix-users >> >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > > |