Search code examples
c#quickfixquickfixn

Sending a Message to a specific session in QUICKFIX N


I've recently been given the task of making a basic trading platform for new traders. I'm connecting to a bank FIX 4.4 implementation.

The bank has specified 2 sessions. One for quote data and one for trade executions.

I'm using QuickfixN and coding in c#

I have set up my initiator session config to have both sessions in it. The port is different and the target comp ids and sender comp ids are different. I can connect to both fine. What i'm struggling with is figuring out how to send my order requests through one session and not the other.

Both sessions require FIX 4.4. By default it just uses the first session.


Solution

  • When you create the initiators, save the session objects into variables. (Perhaps via the OnCreate callback, as done here.)

    Make those variables accessible to the message-sending class.

    Then to send messages, just call one of:

    quoteSession.send(msg)
    tradeSession.send(msg)