[Quickfix-users] switching ordType
Brought to you by:
orenmnero
From: Bobby R. <bob...@gm...> - 2009-10-06 03:29:02
|
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 |