[Quickfix-developers] Conditionally Required Field Missing - New Order
Brought to you by:
orenmnero
From: John D. <jd...@so...> - 2009-08-04 20:39:59
|
Hi There, My Application is receiving the error message "Conditionally Required Field Missing" when it sends a new order to the J-Simulator at PatSystems. For thoroughness sake I have carefully included every type of tag or group that seems remotely related to the new order message, but still get a response indicating that something is missing. There seems to be very little in the forums related to this error. Would you please send me an example of a successful order entry code, or even a tag string? Here is my tag string being sent: 8=FIX.4.2 protocol version 9=248 BodyLength 35=D MessageType, new order single 34=1296 MsgSeqNum 49=APPID_1494 SenderCompID 52=20090804-19:58:25.671 SendingTime 56=PATS TargetCompID 1=HappyTrader1 Account 11=200984155825LongEntry756736 ClOrdID 21=2 HandInst, automated 22=1 IDSource, CUSIP 38=100 orderQty 40=2 OrdType, limit 44=102.599998474121 Price, buy limit price 48=12345 SecurityID 54=1 Side, Buy 55=BBH Symbol 59=0 TimeInForce, Day 60=20090804-15:58:25 TransactTime 78=1 NoAllocs 79=ETB AllocAccount 80=100 AllocShares 111=100 MaxFloor 114=N LocateReqd 121=N ForexReq 386=1 NoTradingSessions, 336=ETB TradingSessionID 439=Penson ClearingFirm 440=My Account # ClearingAccount 10=045 CheckSum Here is my code: Message message = new Message(); Message.Header header = message.getHeader(); Message.Trailer trailer = message.getTrailer(); string trade_side = null; bool locate_stocks_for_shorting = false; header.setField(new BeginString("FIX.4.2")); header.setField(new MsgType("D")); //New Order - Single MsgType <35> = D message.setField(new Symbol(Symbol)); //<55> passed to here by local app message.setField(new ClOrdID(ClOrdID)); //<11> passed to here by local app message.setField(new HandlInst('2')); //<21> Handling Instructions ...Automated execution order, public, Broker intervention OK message.setField(new OrdType('2')); //<40> limit order message.setField(new TransactTime(DateTime.Now)); //<60> message.setField(new TimeInForce('0')); //<59> Day message.setField(new Price(limit_price)); //<44> limit price of limit order message.setField(new OrderQty(num_shares)); //<38> message.setField(new MaxFloor(100)); // <111> Maximum number of shares within an order to be // shown on the exchange floor at any given time. message.setField(new ForexReq(false)); //<121> will forex be needed to execute this order? if (trade_type == "buy") { message.setField(new Side(Side.BUY)); //<54> = 1 trade_side = "buy"; } if (trade_type == "sell") { message.setField(new Side(Side.SELL)); //<54> = 2 trade_side = "sell"; } if (trade_type == "sell_short") { message.setField(new Side(Side.SELL)); //<54> = 2 locate_stocks_for_shorting = true; trade_side = "sell"; } if (trade_type == "buy_to_cover") { message.setField(new Side(Side.BUY)); //<54> = 1 trade_side = "buy"; } message.setField(new LocateReqd(locate_stocks_for_shorting)); //Indicates the broker is not required to locate to short message.setField(new ClearingFirm("Penson")); //Firm that will clear the trade. //Used if different from the executing firm. message.setField(new ClearingAccount("My Account #")); //Supplemental accounting information //forwared to clearing house/firm. message.setField(new NoAllocs(1)); //<78> Number of repeating groups for pre-trade allocation //Create a repeating group NoAllocs QuickFix42.NewOrderSingle.NoAllocs group1 = new QuickFix42.NewOrderSingle.NoAllocs(); group1.set(new QuickFix.AllocShares(100)); //allocate 100 shares group1.set(new QuickFix.AllocAccount("ETB")); //specify the account to allocate them to message.addGroup(group1); message.setField(new NoTradingSessions(1)); //<59> Number of repeating groups for Trading Sessions //Create a repeating group NoTradingSessions QuickFix42.NewOrderSingle.NoTradingSessions group2 = new QuickFix42.NewOrderSingle.NoTradingSessions(); //specify the elements of the repeating group group2.set(new QuickFix.TradingSessionID("ETB")); //<335> my account message.addGroup(group2); message.setField(new Account("HappyTrader1")); //<1> my account number message.setField(new IDSource("1")); //<22> CUSIP // message.setField(new PossDupFlag(false)); //<43> Original Transmission, causes "tag specified out of required order" error message.setField(new SecurityID("12345")); //<48> broker number for this security // message.setField(new SenderSubID("ETB_sub")); //<50> additional account info, causes "tag specified out of required order" error Session.sendToTarget(message, GlobalVars.order_SessionID); //transmit the message to the other end of link Thanks for your help, :) John |