OnixS C++ CME Market Data Handler  4.8.0.10
API documentation
Pages/MarketByOrder.md
Go to the documentation of this file.
1 \addtogroup market-by-order
2 
3 \brief Details of Market By Order (MBO) functionality support.
4 
5 Starting with Q4 2016, CME MDP exposes Market By Order (MBO) functionality
6 with current Market By Price (MBP) functionality. MBO disseminates individual
7 orders and quotes at every price level for a particular instrument. MBO
8 functionality is embedded into existing market events and channels.
9 
10 \section mbo-support API Classes and Members Implementing MBO Functionality
11 
12 The SDK API was enhanced with new classes, listeners and methods to expose
13 the new functionality to the users and provide them with the same experience
14 as they have while working with MBP books.
15 
16 The SDK exposes the new class OnixS::CME::MDH::MboBook representing
17 MBO book. The design and interface of the new class is similar to the
18 classes encapsulating MBP books like the OnixS::CME::MDH::DirectBook.
19 In particular, this class provides access to bids and offers for the
20 given instrument with the help of OnixS::CME::MDH::MboBook::bids and
21 OnixS::CME::MDH::MboBook::asks members respectively. All bids and asks
22 are sorted in the same way as price levels in the MBP books.
23 The OnixS::CME::MDH::Order class encapsulates bids and offers. It
24 exposes order primary details like id, priority, price and display
25 quantity. In contrast to MBP books, MBO book may contain multiple
26 entries having the same price value. Orders with the same price are
27 sorted by priority starting from the lowest to highest no matter
28 whether a single order is representing bid or offer.
29 
30 To get subscribed to MBO book updates, it's necessary to
31 override OnixS::CME:MDP3::SecurityListener::onBookUpdate
32 member of OnixS::CME:MDP3::SecurityListener and bind instance
33 of listener to the instance of OnixS::CME::MDH::Handler class
34 using OnixS::CME::MDH::Handler::registerSecurityListener.
35 
36 Also, the correspondent Handler's parameter defines
37 whether to maintain MBO order books:
38 
39 ~~~{.cpp}
40 
41 handlerSettings.bookManagement().mboBooks().maintain(true);
42 
43 ~~~
44 
45 \note Currently, the SDK exposes different book update notification
46 strategies. By default, books of each type (direct, implied, etc)
47 are delivered to the user at the end of the corresponding market event (see
48 \ref book-update-notification-strategies and OnixS::CME::MDH::EventListener
49 for more information). CME MDP uses the same 'End Of Real Quotes' event to
50 define the end of MBO and direct book update transactions. Therefore, MBO
51 books updates are triggered at the same time points as MBP direct books are.
52 
53 \section mbo-book-maintenance Accurate MBO Book Maintenance and Natural Refresh for MBO Books
54 
55 The Handler supports both accurate maintenance and natural refresh
56 for MBO books. Users should not experience any difference in MBP and
57 MBO order book maintenance.
58 
59 \note Classes implementing price levels in MBP books (like the
60 OnixS::CME::MDH::DirectPriceLevel) have a member identifying
61 whether level data is available when books are naturally
62 refreshed. In case of MBO books, there's no such attribute.
63 All orders are placed one by one in a defined order.
64 
65 \section mbo-and-mbp-recovery Market State Recovery for MBO books
66 
67 In case of late join or data loss, the Handler performs
68 a large-scale market state recovery using snapshot feeds.
69 
70 In contrast to real-time updates, when data for all kind of books is
71 transmitted using the same incremental feed, the recovery from snapshots
72 uses separate 'snapshot MBO' feeds. Therefore, the Handler uses the corresponding
73 snapshot feeds for particular book types when the recovery is performed.
74 Therefore, Handler processes market data from two sources (regular and
75 MBO snapshot feeds), if the users are subscribed to both MBO and MBP books.
76 An important aspect is the fact of performing two recovery procedures
77 for MBP and MBO books may cause increase time of overall recovery since
78 the Handler has to wait until the end of both procedures before switching
79 to real-time data processing.
80 
81 \note Both MBP and MBO recovery feeds transmit recent trades and
82 latest statistics. The Handler raises events for trades and statistics
83 taken from snapshots for MBP books, if both MBP and MBO recovery sources
84 are used. Users, who're interested in having statistics and top of MBP
85 book sent in snapshots for MBO book, may consider listening to market
86 data messages using OnixS::CME::MDH::MessageProcessingListener to have
87 MBO snapshot data for their needs.