OnixS C++ CME MDP Conflated UDP Handler  1.1.2
API documentation
Manipulating Books

Inner Contents

 Book Update Notification Strategies
 
 Maintaining Books by Natural Refresh
 
 Building and Maintaining Books by Yourself
 
 Tracking Best Bids and Offers Only
 
 Constructing And Copying Books
 

Detailed Description

Order Books in the SDK

Each security has MBP book. The SDK exposes the corresponding class: OnixS::CME::ConflatedUDP::DirectBook.

The Handler notifies a client code through the OnixS::CME::ConflatedUDP::SecurityListener::onBookUpdate callback once a security's book of any type is updated.

The instrument definition defines the book depth for market by price (MBP) books. It is exposed as the OnixS::CME::ConflatedUDP::MbpBook::depth member. The returned value defines the maximum number of price levels that may exist in the book.

The OnixS::CME::ConflatedUDP::MbpBook::bids and OnixS::CME::ConflatedUDP::MbpBook::offers members of the OnixS::CME::ConflatedUDP::MbpBook class are exposed to access price value and quantity information for all levels available in the book.

Also, order book maintenance is explicitly defined by the Handler configuration.

The following code sample defines how to manage maintenance of order books using Handler settings:

// An instance to be configured.
Handler handler;
// Quicker access to book-related settings.
BookManagement& bookManagement =
handler.settings().bookManagement();
// Let Handler to maintain direct books. Once parameter is set
// to 'true', Handler will invoke SecurityListener::onBookUpdate()
// member passing instance of a valid direct book.
bookManagement.directBooks().maintain(true);

Behavioral Traits

The Handler constructs books for each security since the moment it receives a definition for that security. Books are changed in time, 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 handling and do not store references to any book instance and data returned by its members like offers and bids collections. This restriction exists because the Handler may change internal book structures at the same time. If any data exposed by a instance instance must be used outside of event handling, it must be copied before later use.

See also
Constructing And Copying Books, OnixS::CME::ConflatedUDP::SecurityListener