Re: [Quickfix-users] switching ordType
Brought to you by:
orenmnero
From: Grant B. <gbi...@co...> - 2009-10-06 03:53:07
|
And the compile error is...? On Mon, Oct 5, 2009 at 10:28 PM, Bobby Richards <bob...@gm...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > I am trying to build a new order based on a conditional value from a db. I can create the order manually with no problem if I hard code in the order type > > //Create FIX44 message > FIX44::NewOrderSingle newOrder( > FIX::ClOrdID(ordID), > FIX::Side(side), > FIX::TransactTime(), > FIX::OrdType(FIX::OrdType_MARKET) > ); > > dealing with the side if I do the following it works no problem as well: > FIX::Side side; > ... > switch(atoi(row->Get(4))) //where row->Get(4) is an int from a mysql database > { > case 1: side = FIX::Side_BUY; break; > case 2: side = FIX::Side_SELL; break; > case 5: side = FIX::Side_SELL_SHORT; break; > } > However if I try the same with OrdType i get a compile error > Tried all three; > FIX::OrdType ordType; > const char ordType; > char ordType; > switch(atoi(row->Get(2))) > { > case 1: ordType = FIX::OrdType_MARKET; break; > case 2: ordType = FIX::OrdType_LIMIT; break; > case 3: ordType = FIX::OrdType_STOP; break; > } > Thanks in advance > Bobby > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > > |