OnixS C++ CME MDP Premium Market Data Handler  5.8.3
API Documentation
Order Books

Inner Contents

 Book update notification strategies
 Tracking best bids and offers only
 Constructing and copying order books
 Custom order book building

Detailed Description

Order book types

For each security, two types of order books are available: "Market By Order" (MBO) and "Market By Price" (MBP). The last one consists of three sub-types: direct, implied, and consolidated.

The SDK exposes the corresponding classes:

See also
CME Documentation: Market by Order (MBO)
The CME MDP Premium Platform transmits data for MBO, direct, and implied books only. Consolidated books are maintained by the handler using direct and implied books.

The handler notifies a client code via the OnixS::CME::MDH::SecurityListener::onBookUpdate callback when an order book is updated.

The instrument definition defines the order book depth for market-by-price (MBP) books: direct, implied and consolidated. The OnixS::CME::MDH::MbpBook::depth method returns the maximum number of price levels that may exist in the book.

The OnixS::CME::MDH::MbpBook::bids and OnixS::CME::MDH::MbpBook::offers members provide access to price, value, and quantity information for all levels available in the book.

Similarly, the OnixS::CME::MDH::MboBook class includes the OnixS::CME::MDH::MboBook::bids and OnixS::CME::MDH::MboBook::offers members to access details for all orders available in the book.

Order book maintenance

The order book maintenance is configurable.

For example:

BookManagement& bookManagement = handler.settings().bookManagement();
// Configures the Handler to maintain direct books. Once the parameter is set to `true`,
// the Handler will invoke `SecurityListener::onBookUpdate()` member passing instance of a valid direct book.
// Suppresses implied order book maintenance.
// However, if consolidated order book maintenance is enabled, implied order book will also be maintained.
// Therefore, this statement only suppresses implied order book update event triggering.
// Configures the Handler to consolidated books. Once the parameter is set to `true`,
// the Handler will invoke `SecurityListener::onBookUpdate()` member passing instance of a valid consolidated book.

Accessing books outside event handlers

The handler constructs books for each security since the moment it receives a definition for that security. Books could be changed later, and their members are not thread-safe. The handler uses its synchronization primitives while updating the books. Therefore, do not access price levels information outside of book-related event handler and do not store references to any book instance and data returned by its members (e.g., offers and bids collections). This restriction exists because the handler may update the book at any moment.

If any data exposed by a book instance must be used outside of the event handler, it must be copied first.

See also