By default, the Handler invokes the OnixS::CME::MDH::SecurityListener::onBookUpdate callback each time it receives book-related data via real-time or recovery feeds. Received and processed updates may refer to any level and side in a book. Sometimes, there's no interest in having updates for any price level in a book except top one. For this reason, the Handler allows getting notified only about updates of the best bid or offer.
To take advantage of such facility the Handler exposes best bid/offer tracking parameters which may be defined through the OnixS::CME::MDH::HandlerSettings class interface. Its OnixS::CME::MDH::HandlerSettings::bookManagement section exposes three members: OnixS::CME::MDH::BookManagement::directBooks, OnixS::CME::MDH::BookManagement::impliedBooks and OnixS::CME::MDH::BookManagement::consolidatedBooks each of which returns a mutable instantiation of the OnixS::CME::MDH::BookManagementAndTracking template class. Returned instance of OnixS::CME::MDH::BookManagementAndTracking in own turn provides access to BBO tracking parameters specialized for a particular book type via OnixS::CME::MDH::BookManagementAndTracking::bboTracking member.
OnixS::CME::MDH::DirectBBOTracking structure for direct books (OnixS::CME::MDH::ImpliedBBOTracking structure for implied and consolidated books respectively) exposes members for each price level attribute like price (OnixS::CME::MDH::DirectBBOTracking::price) and quantity (OnixS::CME::MDH::DirectBBOTracking::quantity) allowing to define tracking.
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 best bid/offer exceeds threshold bounds.
OnixS::CME::MDH::BBOThreshold::threshold member allows to control the sensitivity of Handler to the updates. The value specified via given member allows defining sensitivity threshold for the best bid/offer. If 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 - not.
The following example demonstrates how to configure the Handler to get book updates only when the price of the best bid or offer changes for more than 10% or quantity changes for more than 50%.