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 to BBO tracking settings for every book type:
Access the tracking object through the corresponding book-management setting's OnixS::CME::MDH::BaseBookManagement::bboTracking method. MBO tracking supports price changes. Implied and consolidated tracking support price and quantity changes. Direct tracking additionally supports changes in the number of orders.
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 BBO updates. The threshold is relative to the previous attribute value: the handler raises an event when the absolute change is greater than the configured threshold multiplied by the absolute previous value. For example, a threshold of 0.1 requires a change greater than 10%.
The following example demonstrates how to configure the handler to get book updates only when the best bid price or offer changes by more than 10% or the quantity changes by more than 50%: