Inner Contents | |
Adjusting Handler Settings | |
Listening to Market Data | |
Replaying Log Files | |
All Handler classes are encapsulated into the OnixS::Senaf::MarketData namespace. Header files are collected in the master OnixS/Senaf/MarketData.h
header file for more convenience.
The following sections will guide through the major steps to be done to succeed with market data processing.
Market data processing machinery is incapsulated in the OnixS::Senaf::MarketData::Handler class. Single instance of the OnixS::Senaf::MarketData::Handler processes market data for multiple SENAF subscriptions.
Before an instance of the OnixS::Senaf::MarketData::Handler class can be constructed, settings affecting its behavior are to be defined.
All parameters controlling the various aspects of market data processing and behavior of the OnixS::Senaf::MarketData::Handler are gathered into the OnixS::Senaf::MarketData::HandlerSettings class.
For most cases default parameter values are set defining the most likeable behavior of the OnixS::Senaf::MarketData::Handler instance. However, some parameters are to be set before moving to the OnixS::Senaf::MarketData::Handler instance construction.
The SDK needs a valid license for successful execution. If an SDK licensing services are not be able to find a valid license, an exception will be thrown at the initialization stage when the OnixS::Senaf::MarketData::Handler constructor is called.
The OnixS::Senaf::MarketData::HandlerSettings class exposes the OnixS::Senaf::MarketData::HandlerSettings::licenseDirectory for instruction to SDK where to look for a valid license. By default, SDK looks for a license in the current directory for the application. However, by using noted parameter, it's possible to specify another folder anywhere on file system.
The following example demonstrates how initialization works:
See Handler's Settings for more information on adjusting behavior of the Handler.
The Handler may log market data it processes for further use by the replaying feature or analysis as well as other important events which may take place during the regular market data processing.
SDK provides various implementations of logging for different purposes. File-based logging is a satisfactory choice for the most cases.
Below is an example of how file based logging can be established:
Once instance of OnixS::Senaf::MarketData::Handler is constructed, market data processing can be spawned. However, to get the results of market data processing like received messages, it's necessary to subscribe to the corresponding events.
See Event Listeners on which events are exposed by the Handler and how to subscribe on a particular event.
As soon as instance of OnixS::Senaf::MarketData::Handler is configured and listeners to events of interest are registered, market data processing can be initiated.
Market data processing is initiated by invoking the OnixS::Senaf::MarketData::Handler::start method.
To accomplish live market data processing, OnixS::Senaf::MarketData::Handler::stop member is to be called: