Previously, Handler offered predefined set of market data processing patterns. Given processing patterns covered most frequently used cases of market data processing like late join with accurate order book maintenance or order book natural refresh using real-time feeds only. However, certain lack of flexibility was experienced by users who wanted to have more customization for processing session like using TCP Recovery facility in case of natural refresh.
Starting from version 4 of SDK, market data processing session has been enhanced and improved. Now Handler allows to use TCP recovery facilities for book natural refresh or to combine join recovery with natural refresh and so forth.
Behavior of processing session is now defined by a set of parameters gathered into OnixS::CME::MDH::SessionSettings class. Instance of OnixS::CME::MDH::SessionSettings is passed to OnixS::CME::MDH::Handler::start as a parameter.
Settings allow to define whether market data recovery must be done at the beginning of market data processing or in case of data loss or other processing error and so on. Also, settings allow to define which type of market (by price or by order or both) is to be recovered.
Table below describes primary parameters affecting market data processing:
| Parameter | Description | Behavior Visualization |
|---|---|---|
| OnixS::CME::MDH::SessionSettings::joinRecovery | Defines whether Handler must recover either instruments or entire market state or nothing when joins trading session. For a complete list of available options see OnixS::CME::MDH::JoinRecoveryOptions::Enum items.
|
|
| OnixS::CME::MDH::SessionSettings::gapAndErrorHandling | When real-time market data is processed, processing failure may take place due to errors in transmitted data or due to data loss. Handler allows to control its behavior in such cases. With the help of given parameter it's possible to specify whether real-time market data processing should continue or Handler must recover market state to have accurate order books. Also, Handler may recover all instruments in addition to market state to have accurate list of securities being traded. See OnixS::CME::MDH::GapAndErrorHandlingOptions::Enum for a complete list of available options.
| |
| OnixS::CME::MDH::SessionSettings::marketRecovery | Given parameter controls aspects of Handler behavior in case of market recovery. If processing session has to perform market state recovery due to either late join or processing failure, given parameter allows to define type of market to be recovered. Starting from Q4 of 2016, CME MDP offers market by order (MBO) data in addition to market by price (MBP) one. Although data for both MBO and MBP is combined on real-time feed, recovery is separated for each type of market. As a result, Handler has to be instructed which type of market or all markets are to be recovered. For a complete list of options, see OnixS::CME::MDH::MarketRecoveryOptions::Enum.
|
|
Following code snippet depicts how to configure market data processing session to maintain order books accurately starting from the middle of trading session (late join).
Following code snippet depicts how to configure market data processing session to maintain MBP books accurately starting from the beginning of trading session when market is at blank state and no initial recovery is needed to catch-up up-to-date market state.
Following code snippet depicts how to configure market data processing to maintain order books in natural refresh mode, but with initial recovery at join stage. Given configuration is frequently used in cases, when server running market data processing is collocated in CME network and possibility of data loss is minimal. It gives almost same benefits as accurate order book maintenance, but in case of data loss it will not let real-time processing to freeze due to necessity in performing market recovery.
Following code snippet helps to configure market data processing to maintain order books in natural refresh mode. But, in constrast to regular case when real-time processing is resumed immediately, in given case Handler will try to recover missing data using TCP Recovery Feed.