141 lines
17 KiB
HTML
141 lines
17 KiB
HTML
<!-- HTML header for doxygen 1.8.7-->
|
|
<!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.3.0</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>
|
|
</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>All Handler classes are encapsulated into the <a class="el" href="namespaceOnixS_1_1CME_1_1MDH.html">OnixS::CME::MDH</a> namespace. Header files are collected in the master <code>OnixS/CME/MDH.h</code> header file for more convenience.</p>
|
|
<p>Following sections will 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>SDK needs a valid license for successful execution. If SDK licensing services are not able to find a valid license exception will be thrown at the initialization stage when <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 and each time attempt to start live market data processing using <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><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 <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1InitializationSettings.html#a3723b14f494c911d6294abf28a154156">OnixS::CME::MDH::InitializationSettings::licenseStore</a> member to be used to instruct SDK where to look for a valid license. By default, SDK looks for a license in the current directory for the application. However, by using noted parameter, it's possible to specify another folder anywhere on file system.</p>
|
|
<dl class="section note"><dt>Note</dt><dd>SDK looks for a valid license in the specified folder and selects the best one. If multiple license available, it will select most significant one (for example, production instead of trial if both are available).</dd></dl>
|
|
<p>Following example demonstrates how 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>Market data processing machinery is incapsulated in the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> class. 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 CME channel.</p>
|
|
<p>Before instance of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> class can be construct, settings affecting its behavior are to be defined.</p>
|
|
<p>All parameters controling varios aspects of market data processing and behavior of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> are gathered into <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1HandlerSettings.html" title="Handler's configuration settings. ">OnixS::CME::MDH::HandlerSettings</a> class.</p>
|
|
<p>For the most cases default parameter values are set defining most likeble behavior of the <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> instance. However, some parameters are to set before moving to <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> instance construction.</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>Network layer responsible for receiving market data trasmitted by MDP is encapsulated into a <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. Therefore, to have successfull market data processing from live MDP environment, it's necessary to construct instance of the Feed Engine and bind it to the previously constructed instance of <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><a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> does not manage life-time of binded <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, keeping instance of <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> valid while it's binded to the instance of <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> is fully user responsibility.</dd></dl>
|
|
<h1><a class="anchor" id="binding-logger-to-handler"></a>
|
|
Logging Market Data and Other Events (Optional)</h1>
|
|
<p>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>Logging service is encapsulated into <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Logger.html" title="Abstraction of logger. ">OnixS::CME::MDH::Logger</a> abstraction. 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><a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> does not manage life-time of binded <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Logger.html" title="Abstraction of logger. ">OnixS::CME::MDH::Logger</a> instance. Therefore, keeping instance of <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Logger.html" title="Abstraction of logger. ">OnixS::CME::MDH::Logger</a> valid while it's binded to the instance of <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> is fully user responsibility.</dd></dl>
|
|
<h1><a class="anchor" id="registering-listeners-with-handler"></a>
|
|
Subscribing to Market Data Events</h1>
|
|
<p>Once instance of <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> is constructed and binded to the instance of <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 spawned. However, to get results of market data processing like updated order books, it's necessary to subscribe to corresponding events.</p>
|
|
<p>See <a class="el" href="group__event-listeners.html">Event Listeners</a> on which events are exposed by the Handler and how to subscribe on a particular event.</p>
|
|
<h1><a class="anchor" id="spawning-md-processing"></a>
|
|
Spawning Market Data Processing</h1>
|
|
<p>As soon as instance of <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html">OnixS::CME::MDH::Handler</a> is configured, binded to a valid instance of <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 to events of interest are registered, market data processing can be initiated.</p>
|
|
<p>Market data processing by initiated by invoking <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 instance of <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1SessionSettings.html">OnixS::CME::MDH::SessionSettings</a> class defining behavior of the Handler for the session.</p>
|
|
<p>For the most common processing scenarios, 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>To accomplish live market data processing, <a class="el" href="classOnixS_1_1CME_1_1MDH_1_1Handler.html#a8c528baf37154d347366083f0f816846" title="Stops the Handler. ">OnixS::CME::MDH::Handler::stop</a> member is to be called:</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.7-->
|
|
<!-- 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>
|