Files
externals/linux/doc/Onixs.CME.4.8.0/html/BuildingBooksByYourself_8md_source.html

82 lines
11 KiB
HTML

<!-- HTML header for doxygen 1.8.11-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>OnixS C++ CME Market Data Handler: Pages/BuildingBooksByYourself.md Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="onixs-doxygen.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
$(window).scroll(function() {
if ($(this).scrollTop() > 1)
{
$('header').addClass("sticky");
}
else
{
$('header').removeClass("sticky");
}
});
</script>
</head>
<body>
<header>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><a href="http://www.onixs.biz"><img alt="Logo" src="onixs.svg"/></a></td>
<td style="padding-left: 0.5em;">
<div id="projectname">OnixS C++ CME Market Data Handler
&#160;<span id="projectnumber">4.8.0.10</span>
</div>
<div id="projectbrief">API documentation</div>
</td>
</tr>
</tbody>
</table>
</div>
</header>
<div id="wrapper">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Home</span></a></li>
<li><a href="modules.html"><span>Contents</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Pages/BuildingBooksByYourself.md</div> </div>
</div><!--header-->
<div class="contents">
<a href="BuildingBooksByYourself_8md.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;\addtogroup book-self-building</div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;</div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;\brief Provides information on how users can build order books </div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;using atomic book updates from market data transmitted by CME</div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;without using Handler&#39;s built-in facilities. </div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;</div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;\section book-bricks Books Building Bricks</div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;</div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;The Handler builds and maintains books for each security by </div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;itself and exposes the results to user code if the user requests </div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;order book maintenance through the Handler settings.</div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;Sometimes there&#39;s a need to build and maintain books by own if, </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;for example, a custom book structure is used by the application. </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;Book atomic updates represent the same elementary quants of market </div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;data as trades and statistics do.</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;To get notified on book atomic updates into a book it is necessary to</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;override OnixS::CME::MDH::SecurityListener::onBookAtomicUpdate members and</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;register listener instance via OnixS::CME::MDH::Handler::registerSecurityListener</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;member.</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;\note Atomic updates may come at real time via incremental </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;feed or from snapshots while the market state is recovered. </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;Therefore, OnixS::CME::MDH::SecurityListener has two overloads </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;each of which exposes data based on its source.</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;An event exposes detailed information of elementary operations on bids or offers.</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;\note There&#39;s no ability to listen to atomic updates for the consolidated book</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;because this type of book is produced as a result of combining updated direct and</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;implied books.</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;\section book-atomic-update-machinery Book Atomic Update Machinery and Relation with &#39;Book Update&#39; Event</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;A book atomic update is delivered to client code via the </div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;OnixS::CME::MDH::SecurityListener::onBookAtomicUpdate member</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;and represents an elementary operation over a book. </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;Therefore, the OnixS::CME::MDH::SecurityListener::onBookAtomicUpdate may be </div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;invoked more frequently compare to the OnixS::CME::MDH::SecurityListener::onBookUpdate member. </div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;In fact, the OnixS::CME::MDH::SecurityListener::onBookAtomicUpdate member usually is invoked </div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;several times before a single invoke of the OnixS::CME::MDH::SecurityListener::onBookUpdate</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;is done.</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;When the Handler delivers an order book via the </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;OnixS::CME::MDH::SecurityListener::onBookUpdate callback, </div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;that book is always in a valid and up-to-date state. In contrast, the </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;OnixS::CME::MDH::SecurityListener::onBookAtomicUpdate is a notification </div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;on an elementary action over a book. Usually, there&#39;re multiple atomic </div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;updates inside a single snapshot or incremental refresh transmitted by MDP. </div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;As a result, a book may not be in a valid state between two atomic updates.</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;Only when the Handler processes all atomic updates belonging </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;to a single market event, a book becomes in a valid state. The </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;OnixS::CME::MDH::SecurityListener::onBookUpdate callbacks are </div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;called exactly at the time when the Handler processes all atomic </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;updates and all book appear to be valid and up-to-date.</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;To build an order book properly, it is necessary also to listen to Hander events. </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;When error or data loss occurs, Handler may spawn market state recovery. Therefore, </div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;if the Handler invokes the OnixS::CME::MDH::HandlerListener::onMarketRecovery, all </div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;books for all securities in bounds of the channel must be empty. Afterwards, the </div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;Handler will provide atomic updates recovered from snapshot messages.</div></div><!-- fragment --></div><!-- contents -->
<!-- HTML footer for doxygen 1.8.11-->
<!-- start footer part -->
<footer>
<hr class="footer"/>
<address class="footer">
<small>&copy; <a href="http://www.onixs.biz">Onix Solutions [On<span class="corporate-orange">i</span>x<span class="corporate-orange">S</span>]</a>. All rights reserved.</small>
</address>
</footer>
</div> <!-- wrapper -->
</body>
</html>