Technology Corner

Home » DotNet » C# » Implementation of FIX messages for Fix 5.0 sp2 and FIXT1.1 specification

Implementation of FIX messages for Fix 5.0 sp2 and FIXT1.1 specification

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 80 other followers

Twitter updates


RSS InfoQ Feeds

  • First Pedestrian Killed by Self-Driving Car
    A pedestrian was killed on Sunday evening in Tempe, Arizona by a self-driving car operated by Uber, the BBC reports. The firm confirmed that the vehicle was traveling in autonomous mode with a safety driver, the only vehicle occupant, behind the wheel during the crash. By Roland Meertens
  • Microsoft Embeds Artificial Intelligence in Windows 10 Update
    The next Windows 10 update opens the way for the integration of artificial intelligence functionalities within Windows applications. Developers will be able to integrate pre-trained deep-learning models converted to the ONNX framework in their Windows applications. By Alexis Perrier
  • Ankyra Presents “Escape”, a Release Automation Tool that Manages Platforms as Logical Components
    Over the last ten years there has been increased focus on infrastructure as code (IaC) tooling, primarily driven by the rise of Infrastructure as a Service (IaaS) and API-driven infrastructure. InfoQ discussed the challenges of homogenising this tooling with Bart Spaans, founder of Ankyra, who is an expert in the domain of infrastructure and release engineer […]
  • Article: Servlet and Reactive Stacks in Spring Framework 5
    Spring Framework 5 supports both traditional servlet-based and reactive web stacks, in the same server application, reflecting a major shift towards asynchronous, non-blocking concurrency in applications. In this article Spring committer Rossen Stoyanchev explores and contrasts both stacks, and explains the range of available choices, and provides guidance f […]
  • Presentation: Elm and Game Development, a Perfect Fit
    Paulo Diniz discusses the Elm architecture, how to use it as functional reactive programming for web game development. By Paulo Diniz
  • Google Releases “Skaffold”, a Tool That Facilitates Continuous Development with Kubernetes
    Google has released Skaffold, an open source command line tool that facilitates continuous development for Kubernetes applications. Skaffold is entering an increasingly crowded space of Kubernetes development automation tooling, including Azure’s Draft, Datawire’s Forge and Weavework’s Flux. By Daniel Bryant
  • Q&A with Marisa Fagen on Security Championship
    Security lead Marisa Fagen recently spoke at QConLondon 2018 about upskilling and elevating engineering team members into the role of Security Champions. We catch up with Fagen and report on her efforts to address contention caused by a scarcity of security professionals. By Rafiq Gemmail
  • GitHub Licensed Aims to Make it Easier to Comply with OSS Licenses
    GitHub Licensed is an open-source tool that aims to simplify the chore of ensuring license soundness and documentation for all dependencies of a GitHub project. By Sergio De Simone
  • Sauce Labs Adds Analytics and Extended Debugging to Continuous Testing Cloud
    At their recent user conference SauceCon, Sauce Labs introduced new capabilities for its continuous testing cloud including test analytics, featuring a dashboard that analyses test results and exposes common failures by browser and operating system, including Android and iOS. By Helen Beal
  • JavaFX and the Future of Java Client Technologies
    Oracle will remove JavaFX, Applets and Java Web Start from the JDK after Java SE 8. Swing and AWT will remain. By Tim Hodkinson


This post will demonstrate how to connect with FIX5.0 server and FIXT1.1 specification and uses of QuickFix/n (native .net FIX engine).


With this release of FIX protocol version 5.0, a new Transport Independence framework (TI) introduced which separates the FIX Session Protocol from the FIX Application Protocol. This gives freedom to send message across different messaging technologies like MSMQ, message bus etc.

Because of different versions of transport and application protocol, we will have to explicitly defines settings in config file.

TransportDataDictionary is used for defining transport protocol version eg. FIXT.1.1.xml

AppDataDictionary is used for defining data dictionary for FIX application protocol version eg. FIX50.xml

You can read more about FIXT1.1 and FIX 5.0 Sp2 specification on



To demonstrate implementation of FIX 5.0 sp2, I’ll use open source FIX engine for .net (QuickFix/N) which is one of open source engine in native .net code.  Code for is available on github and primarily contributed by Connamara System’s developers. These guys are doing commendable job.




This is client application which will connect with FIX server to send and receive FIX messages. I am demonstrating implementation of MarketDataRequest and its responses (MarketDataSnapshot & MarketDataIncrementalRefresh).


Start with Configuration

First we create configuration file for initiator.






*Note- AppDataDictionary is for application protocol eg. FIX 5.0 and TransportDataDictionary is for transport protocol.

You can read more about configuration here.

Create Application Class

Before starting with implementation you would need to have quickFix.dll which is available of github  at


To connect with FIX session, you will have to implement QuickFix.Application interface.

public interface Application
void FromAdmin(Message message, SessionID sessionID);
void FromApp(Message message, SessionID sessionID);
void OnCreate(SessionID sessionID);
void OnLogon(SessionID sessionID);
void OnLogout(SessionID sessionID);
void ToAdmin(Message message, SessionID sessionID);
void ToApp(Message message, SessionID sessionId);

I create one class named FixClient50Sp2 which implements interface and inherit base class for message cracking and getting message events.



FIX Application Setup


Setting up Initiator

// FIX app settings and related
var settings = new SessionSettings(“C:\\initiator.cfg”);

// FIX application setup
MessageStoreFactory storeFactory = new FileStoreFactory(settings);
LogFactory logFactory = new FileLogFactory(settings);
_client = new FixClient50Sp2(settings);

IInitiator initiator = new SocketInitiator(_client, storeFactory, settings, logFactory);
_client.Initiator = initiator;


* _client is instance of class FixClient50Sp2.

Starting Initiator



Implementation of QuickFix.Application Interface methods

/// <summary>
/// every inbound admin level message will pass through this method,
/// such as heartbeats, logons, and logouts.
/// </summary>
/// <param name=”message”></param>
/// <param name=”sessionId”></param>
public void FromAdmin(Message message, SessionID sessionId)

/// <summary>
/// every inbound application level message will pass through this method,
/// such as orders, executions, secutiry definitions, and market data.
/// </summary>
/// <param name=”message”></param>
/// <param name=”sessionID”></param>
public void FromApp(Message message, SessionID sessionID)
Trace.WriteLine(“## FromApp: ” + message);

Crack(message, sessionID);

/// <summary>
/// this method is called whenever a new session is created.
/// </summary>
/// <param name=”sessionID”></param>
public void OnCreate(SessionID sessionID)
if (OnProgress != null)
Log(string.Format(“Session {0} created”, sessionID));

/// <summary>
/// notifies when a successful logon has completed.
/// </summary>
/// <param name=”sessionID”></param>
public void OnLogon(SessionID sessionID)
ActiveSessionId = sessionID;
Trace.WriteLine(String.Format(“==OnLogon: {0}==”, ActiveSessionId));

if (LogonEvent != null)

/// <summary>
/// notifies when a session is offline – either from
/// an exchange of logout messages or network connectivity loss.
/// </summary>
/// <param name=”sessionID”></param>
public void OnLogout(SessionID sessionID)
// not sure how ActiveSessionID could ever be null, but it happened.
string a = (ActiveSessionId == null) ? “null” : ActiveSessionId.ToString();
Trace.WriteLine(String.Format(“==OnLogout: {0}==”, a));

if (LogoutEvent != null)

/// <summary>
/// all outbound admin level messages pass through this callback.
/// </summary>
/// <param name=”message”></param>
/// <param name=”sessionID”></param>
public void ToAdmin(Message message, SessionID sessionID)
Log(“To Admin : ” + message);

/// <summary>
/// all outbound application level messages pass through this callback before they are sent.
/// If a tag needs to be added to every outgoing message, this is a good place to do that.
/// </summary>
/// <param name=”message”></param>
/// <param name=”sessionId”></param>
public void ToApp(Message message, SessionID sessionId)
Log(“To App : ” + message);



Callback to Subscription

public void OnMessage(MarketDataIncrementalRefresh message, SessionID session)
var noMdEntries = message.NoMDEntries;
var listOfMdEntries = noMdEntries.getValue();
//message.GetGroup(1, noMdEntries);
var group = new MarketDataIncrementalRefresh.NoMDEntriesGroup();

Group gr = message.GetGroup(1, group);

string sym = message.MDReqID.getValue();

var price = new MarketPrice();

for (int i = 1; i <= listOfMdEntries; i++)
group = (MarketDataIncrementalRefresh.NoMDEntriesGroup)message.GetGroup(i, group);

price.Symbol = group.Symbol.getValue();

MDEntryType mdentrytype = group.MDEntryType;

if (mdentrytype.getValue() == ‘0’) //bid
decimal px = group.MDEntryPx.getValue();
price.Bid = px;
else if (mdentrytype.getValue() == ‘1’) //offer
decimal px = group.MDEntryPx.getValue();
price.Offer = px;

price.Date = Constants.AdjustedCurrentUTCDate.ToString(“yyyyMMdd”);
price.Time = group.MDEntryTime.ToString();

if (OnMarketDataIncrementalRefresh != null)


Code can be found at github.


  1. louis says:

    Hi Neeraj

    Thanks for a great post. Does this implementaion allow for full FIX 5.0 Sp2 tags, with your sample code I cant seem to get the TargetParties() component on message OrderMassCancelRequest (q).

    Any help will be appreciated.


  2. louis says:

    Hi Neeraj,

    Thanks for the reply

    I downloaded the latest version and still dont have the tag, I see that it is only present in FIX50SP2.xml and not in the others, (suspect that it was intoduced in SP2). I looked at reflector and the DLL does not contain the TargetParties group in the definition. Thus I suspect that the quickfix dll was not compiled with FIX50SP2.xml, might be wrong. Any ideas?


  3. I’ll check with quickfix team about implementations…If you like you can also change quick fix library code for specific requirements.


  4. FIX Coder says:

    Hi Neeraj

    Why do you required any third party tool to implement FIX?FAST.You can create your own C# classes to implement FIX/FAST. Not a good post.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blogs I Follow

%d bloggers like this: