OnixS C++ Fenics UST BIMP Market Data Handler  1.1.0
API documentation
Getting Started

Inner Contents

 Setting Up Feed Engine
 
 Replaying Log Files
 

Detailed Description

C++ Fenics UST BIMP Market Data Handler is a C++ library that provides access to the MILLENNIUM EXCHANGE market data services. Handler encapsulates all low-level aspects of the market data platform allowing focusing on implementing trading solutions and market data processing algorithms. High-level C++ API allows building applications quickly to get market data without much involving in raw protocol specifics.

All Handler classes are encapsulated into the OnixS::FenicsUST::MarketData::Bimp namespace. Header files are collected in the master OnixS/Euronext/MarketData/OptiqMdg/Pitch.h header file for your convenience.

The typical way of using the Handler is as follows:

Configuring and Constructing the Handler

Handler's constructor accepts an instance of settings class which defines values for various parameters for determination the Handler's behavior. Role of the most important parameters that used in regular cases are described below.

Primary Settings

Directory for Log Files

By default, all the important aspects of the Handler's activity are logged. Therefore the Handler must know where this kind of information can be stored on a local file system. OnixS::FenicsUST::MarketData::Bimp::HandlerSettings::logDirectory parameter need be defined for pointing the Handlers place where log files to be stored.

Licensing

To run a Handler's instance it is required to have a license file. When the instance is not able to find a valid license it throws an exception at the initialization stage.

OnixS::FenicsUST::MarketData::Bimp::HandlerSettings contains OnixS::FenicsUST::MarketData::Bimp::HandlerSettings::licenseDirectory member which contains path to directory containing license file(s). If it's value is empty the Handler looks for the license file in current directory.

Note
When there is more than one license file in the license directory the most significant one is used (for example, a production instead of a trial if both are available).

Example

The following example demonstrates how to setup primary settings for OnixS::FenicsUST::MarketData::Bimp::Handler:

// Create an instance Handler's settings.
// This option is used to control verbosity of logger.
// This option is used to specify extra logger settings.
// Logs will be stored in 'logs' local sub folder.
settings.logDirectory = "logs";
// This option is used to instruct the Handler where to look for a valid license.
settings.licenseDirectory = "../../license";
// Set up IP addresses and port numbers for multicast feeds
handlerSettings.useFeedA = true;
handlerSettings.useFeedB = true;

Binding Feed Engine to the Handler

Network layer responsible for receiving market data transmitted by the exchange data interfaces is encapsulated into a OnixS::FenicsUST::MarketData::Bimp::FeedEngine class. Therefore, to have successful market data processing, it's necessary to construct an instance of the Feed Engine and bind it to the previously constructed instance of the Handler class:

SocketFeedEngine feedEngine;
handler.bindFeedEngine(feedEngine);

See Feed Engine for more details on Feed Engine.

Note
Any market data handler does not manage the lifetime of the bound OnixS::FenicsUST::MarketData::Bimp::FeedEngine instance. Therefore, keeping the instance of OnixS::FenicsUST::MarketData::Bimp::FeedEngine valid while it's bound to the instance of OnixS::FenicsUST::MarketData::Bimp::Handler is fully user responsibility.

Building Order Books

The Handler is able to build internal Order Books. To activate this feature, OrderBookListener must be registered.

To achieve better performance, the Order Books are created in the preallocated memory area. To adjust preallocated memory pool size set HandlerSettings::maxBooksObjectAmount. The default value is 500; If the preallocated objects amount is not enough to place all the created books, an exception will be thrown when a book creation fails.

HandlerSettings settings;
// ...
Handler handler(settings);
BookListener listener;
handler.registerOrderBookListener(&listener);

If building internal Order Books is turn on correctly, corresponding callbacks are invoked. OrderBookListener::onOrderBookUpdated is invoked when any Order Book object's state is changed. A reference to the corresponding Order Book object is passed into this callback.

Note
It is entirely ok to store a const reference to OrderBook object in user's code. The lifetime of each Order Book object is equal to the lifetime of the Handler's object. But the state of these objects can be changed by the system at a period between any OrderListener and OrderBookListener callback are invoked.
It is forbidden to change the state of an object passed into the user's callback.

OrderBookListener::onOrderBookOutOfDate is invoked if the Order Book object is out is of date when the system detects inactivity.

Note
For more and up-to-date information on getting started aspects, see GettingStarted sample from the samples collection available in distributive package.