0

I'm sending a new order message (message type 'D') to my FIX server and it's getting kicked back from 'pre-validation' on the server with the response that the stated message body length does not match the actual message.

In a text editor it appears that the declared body length DOES match the message length (measured between the bodylength tag value, and the delimiter preceding the checksum)

Below is the message I am sending (with sensitive data replaced with an equal number of 'x' characters):

8=FIX.4.4^9=183^35=D^34=2^49=xxxxxxxxxxx^52=20130927-19:57:35.771^56=xxx^1=xxxxxxxx^11=123^21=1^38=10^40=1^52=20130927-19:57:35.770^54=1^55=MSFT^59=1^60=20130927-19:57:35.771^100=xxxx^553=xxxxxxxxxx^10=234^

Here is the Business Reject Message (type 'j') that I immediately get back:

8=FIX.4.4^9=126^35=j^49=xxx^56=xxxxxxxxxxx^34=3^52=20130927-16:09:05.888^43=N^372=D^58=PreValidate Failed body lengh problem^380=4^379=2^45=0^10=007^

(the typo is theirs, not mine)

Here is the code used to build the message:

message = fix.Message()
header = message.getHeader()

header.setField(fix.BeginString('FIX.4.4'))
header.setField(fix.SenderCompID('xxxxxxxxxxx'))
header.setField(fix.TargetCompID('xxx'))
header.setField(fix.MsgType('D'))
message.setField(fix.Account(DEMO_Account_Number))
message.setField(fix.HandlInst('1')) #only valid value is '1'
message.setField(fix.OrderQty(int(Test_Order_Qty)))
message.setField(fix.OrdType('1'))  #1=Market, 2=Limit, 3=Stop,4=StopLimit, P=TrailingStop, T=TTO
message.setField(fix.SendingTime(1))
message.setField(fix.Side('1'))    #1=Buy, 2=Sell, 5=Sell Short, and 6=Sell Short Exempt.
message.setField(fix.Symbol('MSFT'))
message.setField(fix.TimeInForce('1'))  # 0 = Day , 1 = GTC.................
message.setField(fix.TransactTime(1))
message.setField(fix.ExDestination('xxxx'))
message.setField(fix.Username(UserName))

fix.Session_sendToTarget(message)

What might be going wrong here? Why is the server kicking it back?

Thanks.

gearhead
  • 787
  • 1
  • 6
  • 26
  • 1
    Using C++ quickfix? Does the message have any special/foreign/non-ascii characters in it? – Grant Birchmeier Sep 27 '13 at 21:22
  • Grant, I am using C++ quickfix compiled using python headers. All the message fields are ascii characters and I have verified that the fields are being filled with the correct datatype (int, char, etc). – gearhead Sep 27 '13 at 22:52
  • 1
    Hi @gearhead, please could you post the code you wrote in order to create your FIX message? – stexcec Sep 28 '13 at 10:24
  • @stexcec I have added the python code above. – gearhead Sep 28 '13 at 13:10
  • 1
    Hi @gearhead, just for testing purpose: if you create a message without a required field, and try to send it, what's the message you receive? – stexcec Sep 28 '13 at 13:25
  • @stexcec, actually that message IS missing a required field, the "ClOrdID" (which I realized after first posting this question). When I added that field in I still get the same error from the server. – gearhead Sep 28 '13 at 13:34
  • 1
    @gearhead: the ClOrdID is the tag #11, and it's present in your message (with value 123). At the moment I cannot test your code, but please read this useful page in order to find out if you create a message with all the required fields: http://www.onixs.biz/fix-dictionary/4.4/msgType_D_68.html#Strucutre – stexcec Sep 28 '13 at 13:40
  • Alternately, I recommend FIXimate: http://www.fixtradingcommunity.org/FIXimate/FIXimate3.0/ – Grant Birchmeier Sep 29 '13 at 21:28
  • @gearhead: do you have some news about your problem? – stexcec Sep 30 '13 at 10:26

0 Answers0