OnixS C++ CME MDP Premium Market Data Handler  5.8.3
API Documentation
Tracking best bids and offers only

By default, the handler invokes the OnixS::CME::MDH::SecurityListener::onBookUpdate callback once it processes book-related data received via real-time or recovery feeds. The updates may refer to any level and side in a book. Sometimes, there's no interest in getting notified of updates for any price level in a book except the top one. For such use cases, the handler allows getting notified only on updates of the best bid or offer.

The OnixS::CME::MDH::HandlerSettings::bookManagement method provides access toOnixS::CME::MDH::BookManagement::directBooks, OnixS::CME::MDH::BookManagement::impliedBooks and OnixS::CME::MDH::BookManagement::consolidatedBooks methods. The returned instances allow configuring best bid/offer (BBO) tracking parameters for the corresponding book type.

For direct books, the OnixS::CME::MDH::DirectBboTracking class exposes members for each price level attribute like price (OnixS::CME::MDH::DirectBboTracking::price) and quantity (OnixS::CME::MDH::DirectBboTracking::quantity). The same is done by the OnixS::CME::MDH::ImpliedBboTracking and OnixS::CME::MDH::MboBboTracking classes for implied and MBO books, respectively.

The OnixS::CME::MDH::BboThreshold::enabled member defines whether the particular attribute must be tracked for changes. The handler raises a book update only if the BBO exceeds the threshold bounds.

The OnixS::CME::MDH::BboThreshold::threshold member controls the sensitivity of the handler to the updates. The specified value defines the sensitivity threshold for the best bid/offer. If the price-level attribute (price, quantity) of the best bid or offer changes for more than the specified value, the Handler raises an appropriate event. Otherwise - it does not.

Example

The following example demonstrates how to configure the handler to get book updates only when the best bid price or offer changes for more than 10% or the quantity changes for more than 50%:

Handler handler;
DirectBboTracking& bboTracking = handler.settings().bookManagement().directBooks().bboTracking();
bboTracking.price().enabled(true).threshold(Decimal(10, 1));
bboTracking.quantity().enabled(true).threshold(Decimal(50, 1));