OnixS C++ CME MDP Premium Market Data Handler  5.8.9
API Documentation
Market by Order

Along with Market By Price (MBP), CME MDP 3.0 exposes Market By Order (MBO ) functionality. MBO disseminates individual orders and quotes at every price level for a particular instrument.

MBO-related API

The OnixS::CME::MDH::MboBook class provides access to bids and offers for the given instrument with the help of OnixS::CME::MDH::MboBook::bids and OnixS::CME::MDH::MboBook::offers members, respectively. All bids and offers are sorted in the same way as price levels in the MBP books.

The OnixS::CME::MDH::Order class encapsulates bids and offers. It exposes order primary details like id, priority, price and display quantity. In contrast to MBP books, an MBO book may contain multiple entries having the same price value. Orders with the same price are sorted by priority, starting from the lowest to highest, no matter whether a particular order represents a bid or offer.

To get subscribed to MBO book updates, it is necessary to override the OnixS::CME::MDH::SecurityListener::onBookUpdate member of OnixS::CME::MDH::SecurityListener and bind the listener instance to the OnixS::CME::MDH::Handler instance using the handler.settings().listeners().security(&listener) path.

MBO book maintenance is configured by the parameter that can be accessed using the handler.settings().bookManagement().mboBooks().maintain(bool status) path.

struct MboBookListener : public SecurityListener
{
void onBookUpdate(Handler&, const Security&, const MboBook& book) override
{
std::cout << toFormattedStr(book) << std::endl;
}
};
MboBookListener listener;
Handler handler;
handler.settings().listeners().security(&listener);
handler.settings().bookManagement().mboBooks().maintain(true);
Note
The SDK exposes different book update notification strategies. By default, books of each type (direct, implied, etc) are delivered to the user at the end of the corresponding market event (see Book update notification strategies for more information). CME MDP 3.0 uses the same 'End Of Real Quotes' event to define the end of MBO and direct book update transactions. Therefore, MBO book updates are triggered at the same time points as MBP direct books are.

Accurate book maintenance and Natural Refresh for MBO Books

The handler supports both accurate maintenance and Natural Refresh for MBO books. Users should not experience any difference in MBP and MBO order book maintenance.

Note
Classes implementing MBP book price levels (like OnixS::CME::MDH::DirectPriceLevel) have a member identifying whether level data is available when books are naturally refreshed. In the case of MBO books, there is no such attribute.

Market state recovery for MBO books

In case of late join or data loss, the handler performs a large-scale market state recovery using Market Recovery Feeds.

In contrast to real-time updates, when data for all kinds of books are transmitted using the same Incremental Feeds, the MBO recovery uses separate "MBO" Market Recovery Feeds. The handler processes market data from two sources (MBP and MBO Market Recovery Feeds) if the user subscribed to both MBO and MBP books. Two separate recovery procedures (for MBP and MBO books) may increase the recovery time because the handler must wait until both procedures are finished before switching to real-time data processing.

Note
Both MBP and MBO Market Recovery Feeds transmit recent trades and the latest statistics. The handler raises events for trades and statistics taken from snapshots for MBP books if both MBP and MBO recovery sources are used. Users interested in having statistics and the top of MBP books sent in "Snapshots for MBO" may consider listening to market data messages using OnixS::CME::MDH::MarketDataListener.