142 lines
18 KiB
HTML
142 lines
18 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: Getting Started</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
|
|
 <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 class="current"><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><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#groups">Inner Contents</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">Getting Started</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
|
|
Inner Contents</h2></td></tr>
|
|
<tr class="memitem:group__handler-settings"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__handler-settings.html">Adjusting Handler Settings</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__feed-engine"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__feed-engine.html">Setting Up Feed Engine</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__error-and-warning-handling"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__error-and-warning-handling.html">Handling Issues Like Errors and Warnings</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__processing-session"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__processing-session.html">Market Data Processing Session</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__event-listeners"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__event-listeners.html">Listening to Market Data</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__book-handling"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__book-handling.html">Manipulating Books</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__trade-order-details"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__trade-order-details.html">Trade Order Details</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__security-selection"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__security-selection.html">Selecting Securities of Interest</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__tcp-recovery-facility"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__tcp-recovery-facility.html">Using TCP Recovery Facility</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__logging-options"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__logging-options.html">Logging Services</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:group__log-replay"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__log-replay.html">Replaying Log Files</a></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<p>The <a class="el" href="namespaceOnixS_1_1CME_1_1MDH.html">OnixS::CME::MDH</a> namespace encapsulates the SDK API. The master <code><a class="el" href="MDH_8h.html">OnixS/CME/MDH.h</a></code> header file collects all header files for more convenience.</p>
|
|
<p>Following sections guide through the major steps to be done to succeed with market data processing.</p>
|
|
<h1><a class="anchor" id="specifying-license"></a>
|
|
Initializing and Licensing SDK</h1>
|
|
<p>The SDK needs a valid license for successful execution. If the licensing subsystem is not able to find a valid license, it throws an exception at the initialization stage when the <a class="el" href="namespaceOnixS_1_1CME_1_1MDH.html#ac936946d61a834c440a863159d65e1c2" title="One-time initialization of market data services. ">OnixS::CME::MDH::initialize</a> is called. Also, a license is verified each time an attempt to start market data processing is done using the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html#a706bb1347bedfcfd0cba2ed8d30ae5b1" title="Starts market data processing according to given parameters. ">OnixS::CME::MDH::Handler::start</a> member.</p>
|
|
<p>The <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1InitializationSettings.html" title="Collection of attributes for one-time initialization. ">OnixS::CME::MDH::InitializationSettings</a> class exposes the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1InitializationSettings.html#a3723b14f494c911d6294abf28a154156">OnixS::CME::MDH::InitializationSettings::licenseStore</a> member which must be used to instruct the SDK where to look for a valid license. By default, the licensing services look for a license in the current directory of the application. However, by using noted parameter, it is possible to specify another folder anywhere on file system.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>The licensing subsystem looks for a valid license in the specified folder and selects the best one. If multiple licenses are available, it selects the most significant one (for example, a production license is selected instead of a trial one if both are available).</dd></dl>
|
|
<p>The following example demonstrates how to perform one-time SDK initialization:</p>
|
|
<div class="fragment"><div class="line"><span class="comment">// Parameters for one-time initialization.</span></div><div class="line">InitializationSettings settings;</div><div class="line"></div><div class="line"><span class="comment">// The folder in which the license is stored.</span></div><div class="line">settings.licenseStore(<span class="stringliteral">"license"</span>);</div><div class="line"></div><div class="line"><span class="comment">// Initializes all Handler services explicitly.</span></div><div class="line"><a class="code" href="namespaceOnixS_1_1CME_1_1MDH.html#ac936946d61a834c440a863159d65e1c2">OnixS::CME::MDH::initialize</a>(settings);</div></div><!-- fragment --><h1><a class="anchor" id="constructing-handler-instance"></a>
|
|
Configuring and Constructing the Handler</h1>
|
|
<p>The <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> class incapsulates a market data processing machinery. A single instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> processes market data for a single CME channel.</p>
|
|
<p>The users must define settings affecting market data processing behavior before constructing an instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> class.</p>
|
|
<p>The <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1HandlerSettings.html" title="Handler's configuration settings. ">OnixS::CME::MDH::HandlerSettings</a> class contains all parameters controlling various aspects of market data processing including the behavior of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a>.</p>
|
|
<p>In the most cases, default values are set for parameters defining the most likely behavior of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> instance. However, some parameters must be set explicitly before constructing an instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> class.</p>
|
|
<div class="fragment"><div class="line">HandlerSettings settings;</div><div class="line"></div><div class="line">settings.channel(310);</div><div class="line"></div><div class="line">settings.</div><div class="line"> feeds().</div><div class="line"> connectivityConfigurationFile(<span class="stringliteral">"config.xml"</span>);</div><div class="line"></div><div class="line">Handler handler(settings);</div></div><!-- fragment --><p>See <a class="el" href="group__handler-settings.html">Handler's Settings</a> for more information on adjusting behavior of the Handler.</p>
|
|
<h1><a class="anchor" id="binding-feedengine-to-handler"></a>
|
|
Binding Feed Engine to the Handler</h1>
|
|
<p>The <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1FeedEngine.html" title="Manages processing machinery for market data received from feeds. ">OnixS::CME::MDH::FeedEngine</a> class encapsulates a layer responsible for receiving market data which is transmitted by the CME MDP. Therefore, to have successful processing of market data, it is necessary to construct an instance of the Feed Engine and to bind it to the previously constructed instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> class:</p>
|
|
<div class="fragment"><div class="line">FeedEngineSettings feSettings;</div><div class="line"></div><div class="line">FeedEngine feedEngine(feSettings);</div><div class="line"></div><div class="line">handler.bindFeedEngine(feedEngine);</div></div><!-- fragment --><p>See <a class="el" href="group__feed-engine.html">Feed Engine</a> for more details on Feed Engine.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>An instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> does not manage lifetime of a bound <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1FeedEngine.html" title="Manages processing machinery for market data received from feeds. ">OnixS::CME::MDH::FeedEngine</a> instance. Therefore, user responsibility is to keep an instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1FeedEngine.html" title="Manages processing machinery for market data received from feeds. ">OnixS::CME::MDH::FeedEngine</a> class valid while it is bound to an instance of <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> class.</dd></dl>
|
|
<h1><a class="anchor" id="binding-logger-to-handler"></a>
|
|
Logging Market Data and Other Events (Optional)</h1>
|
|
<p>The Handler may log market data it processes for further use by replay feature or analysis as well as other important events which may take place during regular market data processing.</p>
|
|
<p>The <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Logger.html" title="Abstraction of logger. ">OnixS::CME::MDH::Logger</a> abstract class encapsulates the logging subsystem. The SDK provides various implementations of logging for different purposes. File-based logging is satisfactory choise for the most cases.</p>
|
|
<p>Below is an example of how file based logging can be established:</p>
|
|
<div class="fragment"><div class="line">FileLoggerSettings loggerSettings;</div><div class="line"></div><div class="line"><span class="comment">// Sets filename of log as it was used by older Handlers.</span></div><div class="line">loggerSettings.filename(<a class="code" href="namespaceOnixS_1_1CME_1_1MDH.html#a194c6b882145a3993041bd0db14eb0f4">makeLogFilename</a>(310));</div><div class="line"></div><div class="line"><span class="comment">// Varies which events are to be logged.</span></div><div class="line">loggerSettings.severityLevel(LogSeverity::Debug);</div><div class="line"></div><div class="line">FileLogger logger(loggerSettings);</div><div class="line"></div><div class="line">handler.bindLogger(logger);</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>An instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> does not manage lifetime of a bound <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Logger.html" title="Abstraction of logger. ">OnixS::CME::MDH::Logger</a> instance. Therefore, user responsibility is to keep an instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Logger.html" title="Abstraction of logger. ">OnixS::CME::MDH::Logger</a> class valid while it is bound to an instance of <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> class.</dd></dl>
|
|
<h1><a class="anchor" id="registering-listeners-with-handler"></a>
|
|
Subscribing to Market Data Events</h1>
|
|
<p>Once an instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> is constructed and bound to an instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1FeedEngine.html" title="Manages processing machinery for market data received from feeds. ">OnixS::CME::MDH::FeedEngine</a>, market data processing can be started. However, it's necessary to subscribe to corresponding events to get the results of market data processing like updated order books.</p>
|
|
<p>See the <a class="el" href="group__event-listeners.html">Event Listeners</a> topic concerning which events are exposed by the Handler and how to subscribe to a particular event.</p>
|
|
<h1><a class="anchor" id="spawning-md-processing"></a>
|
|
Spawning Market Data Processing</h1>
|
|
<p>As soon as an instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> is configured, bound to a valid instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1FeedEngine.html" title="Manages processing machinery for market data received from feeds. ">OnixS::CME::MDH::FeedEngine</a> and listeners for events are registered, market data processing can be initiated.</p>
|
|
<p>Market data processing is initiated by invoking the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html#a706bb1347bedfcfd0cba2ed8d30ae5b1" title="Starts market data processing according to given parameters. ">OnixS::CME::MDH::Handler::start</a> member, which accepts an instance of <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1SessionSettings.html">OnixS::CME::MDH::SessionSettings</a> class defining the behavior of the Handler for the session.</p>
|
|
<p>For the most common processing scenarios, the SDK exposes ready-to-use presets of session settings: <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1AccurateLateJoinSession.html">OnixS::CME::MDH::AccurateLateJoinSession()</a>, <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1AccuratePreopeningSession.html">OnixS::CME::MDH::AccuratePreopeningSession</a>, <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1NaturalRefreshSession.html">OnixS::CME::MDH::NaturalRefreshSession</a>, etc. See documentation for noted classes for more details.</p>
|
|
<div class="fragment"><div class="line">handler.start(AccurateLateJoinSession());</div></div><!-- fragment --><p>The <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html#a8c528baf37154d347366083f0f816846" title="Stops the Handler. ">OnixS::CME::MDH::Handler::stop</a> member must be called to accomplish live market data processing:</p>
|
|
<div class="fragment"><div class="line">handler.stop();</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>For more and up-to-date information on getting started aspects, see <b>GettingStarted</b> sample from the samples collection available in distributive package. </dd></dl>
|
|
</div><!-- contents -->
|
|
<!-- HTML footer for doxygen 1.8.11-->
|
|
<!-- start footer part -->
|
|
<footer>
|
|
<hr class="footer"/>
|
|
<address class="footer">
|
|
<small>© <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>
|