OnixS C++ Cboe CFE Multicast PITCH Market Data Handler  1.0.6
API documentation
Getting Started

Inner Contents

 Setting Up Feed Engine
 
 Replaying Log Files
 

Detailed Description

C++ Cboe CFE Multicast PITCH Market Data Handler is a C++ library that provides an 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 to quickly build applications to get market data without much involve into raw protocol specifics.

All Handler classes are encapsulated into the OnixS::EuroTLX::MarketData::MITCH namespace. Header files are collected in the master OnixS/CboeCFE/MarketData/Pitch.h header file for more convenience.

The typical way of using a handler is as follows:

Configuring and Constructing the Handler

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

Primary Settings

Directory for Log Files

By default, all important aspects of handler's activity is logged. Therefore the handler must know where this kind of information can be stored on a local file system. OnixS::CboeCFE::MarketData::Pitch::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::CboeCFE::MarketData::Pitch::HandlerSettings contains OnixS::CboeCFE::MarketData::Pitch::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, production instead of trial if both are available).

Example

Following example demonstrates how to setup primary settings for OnixS::CboeCFE::MarketData::Pitch::RdiHandler:

// 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 trasmitted by Eurex data interfaces is encapsulated into a OnixS::CboeCFE::MarketData::Pitch::FeedEngine class. Therefore, to have successfull market data processing, it's necessary to construct instance of the Feed Engine and bind it to the previously constructed instance of a handler class:

FeedEngineSettings feSettings;
FeedEngine feedEngine(feSettings);
handler.bindFeedEngine(feedEngine);

See Feed Engine for more details on Feed Engine.

Note
Any market data handler does not manage life-time of binded OnixS::CboeCFE::MarketData::Pitch::FeedEngine instance. Therefore, keeping instance of OnixS::CboeCFE::MarketData::Pitch::FeedEngine valid while it's binded to the instance of OnixS::CboeCFE::MarketData::Pitch::Handler is fully user responsibility.

Building Order Books

The handler is able to build internal Order Books. To activate this feature register OrderBookListener.

To achieve better performance the Order Books are created in 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 en exception will be thrown when book creation fails.

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

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

Note
It is completely ok to store a const reference to OrderBook object in user's code. The lifetime of each Order Book object (except for snapshots) is equal to lifetime of the handler's object. But state of these objects can be changed by system at period of time between any OrderListener callback and OrderBookListener::onOrderBookUpdated callback are invoked.
It is forbidden to change state of any object passed into user's callback. In debug version every user's callback is being checked for data corruption or modification.

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

It is possible to make an immutable snapshot of Order Book by invoking OrderBook::snapshot() function. It returns std::auto_ptr for the snapshot object. User can keep this objects as long as it is needed. User is in charge of destroying these objects.

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