0

I am a very new user to Quickfix Python. I want to send a QuoteRequest. My function to create a new quote request message is as below:


import quickfix as fix

def create_quote_request():
    message = fix.Message()
    header  = message.getHeader()
    header.setField(fix.MsgType(fix.MsgType_QuoteRequest))
    gp      = fix.Group()
    gp.setField(fix.Symbol("GBPUSD"))
    gp.setField(fix.Side(fix.Side_BUY))
    gp.setField(fix.Account("TestAcc"))
    gp.setField(fix.Currency("GBP"))
    message.addGroup(gp)
    fix.Session.sendToTarget(message, self.sessionID)

When I execute the code, I am getting error as below:

NotImplementedError: Wrong number r type of arguments for overloaded function 'new_group'.

Possible C/C++ prototypes are:

FIX::Group::Group(int, int)

FIX::Group::Group(int, int, int const[])

FIX::Group::Group(int, int, message_order const &)

FIX::Group::Group(FIX::Group const &)

I did read the documentation and found that the Group object requires arguments Group(int field, int delim)

Not sure what to pass the values for field and delim. Appreciate your response and help.

2
  • It would be helpful to know which version of FIX you're using - 4.0, 4.2 or 4.4? I think the problem is you are creating a base Group class in the 'fix.Group()' call. You need to create a specific Group() object for the QuoteRequest message type. Perhaps the NoUnderlyings (Number of Underlyings) object? Commented Aug 23, 2021 at 19:44
  • Hi @JimmyNJ, I am using the version FIX1.1 Commented Aug 24, 2021 at 19:54

1 Answer 1

1

not sure I´m on time to help. But I will try. I think @JimmyNJ is giving you proper answer.

According to official doc you can easily do it, but you don´t have to use a generic group, you have to use specific group available to your kind of message.

As far as I know, you should program something like this.

from quickfix44 import QuoteRequest
import quickfix as fix
message = QuoteRequest()
group = QuoteRequest.NoRelatedSym()
group.setField(fix.Symbol("GBPUSD"))
group.setField(fix.Side(fix.Side_BUY))
group.setField(fix.Account("TestAcc"))
group.setField(fix.Currency("GBP"))
message.addGroup(group)

I´m assuming you want to add these 4 tags into NoRelatedSym group, based in their tag numbers. I´ve also used FIX 44 version, maybe you are using a different version, but main idea is the same.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.