3

I'm trying to send QuoteRequest to get quote before deciding to whether to place an order, but the Fix server is unhappy. It seems to me that I follow the documentation here and here, but obviously I'm missing something obvious.

Although, I send same message to two identical installations if FIXimulate (Windows and Mac) and receive two different resonses.

here is config.ini

# default settings for sessions
[DEFAULT]
ConnectionType=initiator
ReconnectInterval=60
SenderCompID=BANZAI

[SESSION]
BeginString=FIX.4.2
TargetCompID=FIXIMULATOR
StartTime=00:00:00
EndTime=00:00:00
# overide default setting for RecconnectInterval
ReconnectInterval=30
HeartBtInt=30
SocketConnectPort=9878
# SocketConnectHost=127.0.0.1
SocketConnectHost=192.168.1.67
DataDictionary=FIX42.xml
FileStorePath=.

Message I send: 8=FIX.4.2|9=90|35=R|34=2|49=BANZAI|52=20170322-11:48:49.000|56=FIXIMULATOR|131=0004|146=1|55=AMZN|38=100|10=180

using updated code to avoid fiddling manually with Header:

def sendQuoteRequest(self):
    message = quickfix.Message()
    message.getHeader().setField(quickfix.BeginString(quickfix.BeginString_FIX42))
    message.getHeader().setField(quickfix.MsgType(quickfix.MsgType_QuoteRequest))
    message.setField(quickfix.QuoteReqID("0004"))  # 131

    group = quickfix43.QuoteRequest().NoRelatedSym()
    group.setField(quickfix.Symbol('AMZN'))
    group.setField(quickfix.OrderQty(100))
    message.addGroup(group)

    print "QuoteRequest: " + str(message)
    quickfix.Session.sendToTarget(message, self.sessionID)

But still I have the same error back 58=Unsupported Message Type|372=R|380=3:

  8=FIX.4.2|9=105|35=j|34=2|49=FIXIMULATOR|52=20170322-11:48:49.689|56=BANZAI|45=2|58=Unsupported Message Type|372=R|380=3|10=099

I'm totaly confused and would really appriciate help!

uzla
  • 515
  • 1
  • 4
  • 20
  • You are not using QF correctly. Those header fields should be managed by the engine; you shouldn't set them manually. You really need to reread the QF docs and check out the example apps. – Grant Birchmeier Mar 22 '17 at 02:41
  • 1
    I've updated ode to use groups and no manual intervention in header, butstill no luck. Any suggestions? – uzla Mar 22 '17 at 12:24
  • @GrantBirchmeier Your comment is not helpful. QF docs are poor, to say the least. Official FIX docs do not target Python. Please provide a link to good documentation, if you have found any. – Mike Williamson Jun 22 '20 at 10:31
  • I know this is very late, @uzla, but I did notice: you are using QF version 4.3 for some things and version 4.2 for others. Could that be the issue? – Mike Williamson Jun 22 '20 at 10:33

1 Answers1

0

I have used QF with Python extensively and always set the header fields as in the documentation and as you have done. I think the problem is actually in your last line. Try only passing the message itself, as opposed to the message and your sessionID, like:

quickfix.Session.sendToTarget(message)

Also, when I call this, for some reason I have to write

quickfix.Session_sendToTarget(message)

which is very different. We may be operating with different versions of QF. In any case it looks like your message is going out but if you get desperate you might try the underscore.

Wapiti
  • 1,851
  • 2
  • 20
  • 40
  • Thanks for response. I ahve just tried: quickfix.Session_sendToTarget(message) quickfix.SessionNotFound: Session Not Found It does not like it without session... :-( if I add session in your way, i.e. quickfix.Session_sendToTarget, it still generates same error 58=Unsupported Message Type . Message IS going out and visible on server. Just found that FIXIMULATE server does not seem to recognize 55=AMZN^38=100. It parses group as empty! Any other suggestions? – uzla Mar 22 '17 at 12:52
  • Did you try `quickfix.Session.sendToTarget(message)`? – Wapiti Mar 22 '17 at 12:54
  • I have tried: quickfix.Session.sendToTarget(message) quickfix.SessionNotFound: Session Not Found Please note that the message is going out with my code and reaches the server. Server responses back. but with error on message Content as such. – uzla Mar 22 '17 at 12:59
  • You should look at your outgoing message and make sure all the fields are there. Also, try with the original code you posted, where you were manually populating the header. As I said, that is how I do it. – Wapiti Mar 22 '17 at 13:01
  • Thasnk for the suggestion. I've tried it and it generates exactly the same string as automatically. as the string that is generated is absolutely the same, server behaviour is teh same. it rejects it :-( I think it is something related to group content. To make sure it is captured I have raised another question, it as it is not python spefic idea here http://stackoverflow.com/questions/42952660/fix-quoterequest-parsed-by-fiximulator – uzla Mar 22 '17 at 13:27