0

I am using QuickFix/N to send MultiLeg orders to IB. My message is rejected with the error 58=Value is incorrect (out of range) for this tag (tag = 167). The broker informed me that the proper value for that tag was "MLEG" which is what I set it to. Message flow as follows:

<outgoing> 8=FIX.4.2_9=229_35=AB_34=2_49=direc513_52=20150904-13:46:32.201_56=IB_11=1234.76_15=USD_21=2_38=10000_40=1_54=1_55=ACC-PLD_60=20150904-21:46:32.161_167=MLEG_207=SMART_555=2_600=ACC_608=ES_623=1255_624=1_564=O_600=PLD_608=ES_623=1066_624=2_564=O_10=220_
<incoming> 8=FIX.4.2_9=000238_35=8_34=000002_43=N_52=20150904-13:46:33_49=IB_56=direc513_11=1234.76_17=17556.1441374393.0_150=8_20=0_103=0_39=8_55=USD_38=10000_44=0.00_32=0_31=0.00_14=0_151=0_6=0_54=1_37=0_167=MLEG_58=Unsupported type_60=20150904-13:46:33_40=1_15=USD_10=136_
A first chance exception of type 'QuickFix.IncorrectTagValue' occurred in QuickFix.dll
<event> Message 2 Rejected: Value is incorrect (out of range) for this tag (Field=167)
<outgoing> 8=FIX.4.2_9=128_35=3_34=3_49=direc513_52=20150904-13:46:32.998_56=IB_45=2_58=Value is incorrect (out of range) for this tag_371=167_372=8_373=5_10=204_

The broker informed me that he would check on the rejection but that the second outgoing message indicated that on my side we were rejecting the 167=MLEG and needed to relax that.

I am not sure what is to be done here, but I am using 4.2 and noticed that MLEG was only defined in 4.3. As the broker prefers 4.2, I put the MLEG definition in the 4.3 Data Dictionary. At this point, I no longer got the same error but am now getting an "Unsupported Type" error.

<outgoing> 8=FIX.4.2_9=229_35=AB_34=2_49=direc513_52=20150907-08:17:41.066_56=IB_11=1234.67_15=USD_21=2_38=10000_40=1_54=1_55=ACC-PLD_60=20150907-16:17:41.022_167=MLEG_207=SMART_555=2_600=ACC_608=ES_623=1255_624=1_564=O_600=PLD_608=ES_623=1066_624=2_564=O_10=235_
<incoming> 8=FIX.4.2_9=000238_35=8_34=000002_43=N_52=20150907-08:17:46_49=IB_56=direc513_11=1234.67_17=17556.1441613866.0_150=8_20=0_103=0_39=8_55=USD_38=10000_44=0.00_32=0_31=0.00_14=0_151=0_6=0_54=1_37=0_167=MLEG_58=Unsupported type_60=20150907-08:17:46_40=1_15=USD_10=155_

So the immediate questions which come to mind are:

  1. Why do I get a rejection when the broker said MLEG was acceptable or is this issue simply due to the fact that I didn't have that definition in my 4.2 DD.
  2. Is there something else I should be doing to relax the restriction on my side?
  3. Did I do the right thing to include the definition in the 4.2 DD?
  4. If so, what is meant by unsupported type and why did the message not include a tag reference for the error?
  5. Am I asking the wrong questions and does someone know the right question?
  6. Is there something else obviously wrong with the outgoing message?

I didn't include code because I think I know what code to use to create the message once I know what is the problem. If, however, someone thinks it would be useful, I could do it.

Any help greatly appreciated.

Algodevguy
  • 31
  • 6

1 Answers1

1

MsgType AB (NewOrderMultileg) was only added in FIX 4.3, so I suspect this is the cause of the “Unsupported type” message. You’ll notice you were getting this error in your first example too, where your tag 167 value was being rejected.

Adding the new value to your dictionary is the correct way to add it as a valid value your end.

I suspect your broker actually expects you to send a NewOrderSingle message (35=D) with the MLEG value and any other custom fields, to replicate the functionality of the NewOrderMultileg. Failing that, you'd need to use a more up-to-date version of the FIX protocol (probably 4.4 or 5.0)

Cheers, Campbell

Campbell
  • 62
  • 5
  • Campbell, that is an interesting thought. So, if you are correct, then I would just create a NewOrderSingle and explicitly add tags such as 555 (NoLegs) and repeat a set of 600-series tags for each leg? I would only worry then if they would know how to handle the spread (from their doc:IB interprets values passed in tag 44 (Price) as credit (negative value), debit (positive value) or even (zero). ) Do you have a thought on that? – Algodevguy Sep 07 '15 at 14:31
  • Another comment Campbell, At your suggestion, I just tried 4.4 and am still getting the Unsupported Type. I have no idea what Type it's referring to. Do you? ;-> – Algodevguy Sep 07 '15 at 14:48
  • That's interesting. I think you'll need to speak to the party you're messaging - their tech team should be able to give you more detail on the error message. – Campbell Sep 08 '15 at 14:15
  • Yeah, it really sounds like your counterparty has made a bunch of DD modifications, and you simply need to change your local DD xml file to reflect their mods. They ought to have some kind of doc detailing their supported message set and all of the fields that they expect each message should contain. – Grant Birchmeier Sep 08 '15 at 14:58