<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Au.Tra.Sy blog - Automated trading System &#187; Development</title>
	<atom:link href="http://www.automated-trading-system.com/category/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.automated-trading-system.com</link>
	<description>Systematic Trading research and development, with a flavour of Trend Following</description>
	<lastBuildDate>Wed, 08 Sep 2010 20:32:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Amibroker e-ratio code</title>
		<link>http://www.automated-trading-system.com/e-ratio-amibroker-code/</link>
		<comments>http://www.automated-trading-system.com/e-ratio-amibroker-code/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 12:30:53 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[afl]]></category>
		<category><![CDATA[amibroker]]></category>
		<category><![CDATA[e-ratio]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[optimisation]]></category>
		<category><![CDATA[tradersstudio]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=901</guid>
		<description><![CDATA[I recently posted about the e-ratio as a tool to measure parts of a trading system (the code files to compute the e-ratio in TradersStudio and Excel are also available). The e-ratio is supposed to be a quick tool to check how signals might add some edge to a trading system. However computing the e-ratio [...]


Related posts:<ol><li><a href='http://www.automated-trading-system.com/amibroker-tradersstudio-speed-comparison/' rel='bookmark' title='Permanent Link: Amibroker V. TradersStudio: Speed comparison Fight'>Amibroker V. TradersStudio: Speed comparison Fight</a></li>
<li><a href='http://www.automated-trading-system.com/amibroker-v-tradersstudio-comparison/' rel='bookmark' title='Permanent Link: Amibroker vs TradersStudio: comparison'>Amibroker vs TradersStudio: comparison</a></li>
<li><a href='http://www.automated-trading-system.com/e-ratio-tradersstudio-excel/' rel='bookmark' title='Permanent Link: e-ratio calculation in TradersStudio and Excel'>e-ratio calculation in TradersStudio and Excel</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I recently posted about the <a href="http://www.automated-trading-system.com/e-ratio-trading-edge/">e-ratio</a> as a tool to measure parts of a trading system (the <a href="http://www.automated-trading-system.com/e-ratio-tradersstudio-excel/">code files to compute the e-ratio in TradersStudio and Excel</a> are also available). The e-ratio is supposed to be a quick tool to check how signals might add some edge to a trading system. However computing the e-ratio in TradersStudio is slow (4+ hours for one signal over 100 different durations).</p>
<p>So I decided to give the &#8220;legendary fast&#8221; Amibroker a test to see if it could better TradersStudio&#8217;s performance. After some &#8220;playing and learning&#8221;, I have finalised the code to compute the e-ratio. My big thanks go to the <a href="http://theasxgorilla.blogspot.com/2007/07/how-to-compute-edge-ratio-in-amibroker.html" target="_blank" rel="nofollow">ASX gorilla</a> whose own version forms a large part of my code.<span id="more-901"></span></p>
<p>Below is the code explanation and downloadable <a href="http://www.automated-trading-system.com/wp-content/uploads/2009/11/e-ratio-gorilla.afl" target="_blank">afl file</a>.</p>
<p>Directly from the ASX Gorilla&#8217;s website as a prelude to the code:</p>
<blockquote><p>My implementation of the Edge Ratio involves two profound Amibroker fudges. The first is the use of the AddToComposite function to create a composite ticker symbol in which to hold the ATR array of a given stock for later retrieval within the Custom Back Tester via the Foreign function.</p></blockquote>
<blockquote><p>The second fudge is the use of the VarSet/VarGet function to create a quasi array. This was necessary to overcome the limitation where array elements cannot exceed in number the value of barcount-1.</p></blockquote>
<p>The first part is to actually code up your Buy signal (in our case a Donchian Channel Breakout). The Sell signals are tested separately:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//BUY RULES: implemented with Buy Stop on Upper Donchian Channel(17)</span>
BuyStop <span style="color: #002200;">=</span> Ref<span style="color: #002200;">&#40;</span>HHV<span style="color: #002200;">&#40;</span>High, <span style="color: #2400d9;">17</span><span style="color: #002200;">&#41;</span>,<span style="color: #002200;">-</span><span style="color: #2400d9;">1</span><span style="color: #002200;">&#41;</span>;
Buy <span style="color: #002200;">=</span> Cross<span style="color: #002200;">&#40;</span> High, BuyStop <span style="color: #002200;">&#41;</span>;
BuyPrice <span style="color: #002200;">=</span> Max<span style="color: #002200;">&#40;</span> BuyStop, Low <span style="color: #002200;">&#41;</span>; <span style="color: #11740a; font-style: italic;">// make sure buy price &gt;= Low</span></pre></div></div>

<p>Exiting positions is done on a fixed duration basis:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//Never Sell so that the position is stopped out after N bar instead</span>
Sell <span style="color: #002200;">=</span> <span style="color: #2400d9;">3</span> &gt; <span style="color: #2400d9;">5</span>;
<span style="color: #11740a; font-style: italic;">//Stop the positon and close it after N bars</span>
<span style="color: #11740a; font-style: italic;">//(eratio = N that we step from 1 to 100 in optimisation)</span>
ApplyStop<span style="color: #002200;">&#40;</span> stopTypeNBar, stopModeBars, eratio <span style="color: #002200;">&#41;</span>;</pre></div></div>

<p>The first fudge mentioned above to store the ATR:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">Normaliser <span style="color: #002200;">=</span> ATR<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">17</span><span style="color: #002200;">&#41;</span>;
AddToComposite<span style="color: #002200;">&#40;</span>Normaliser, <span style="color: #bf1d1a;">&quot;~atr_&quot;</span><span style="color: #002200;">+</span>Name<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>, <span style="color: #bf1d1a;">&quot;C&quot;</span>, <span style="color: #2400d9;">1</span><span style="color: #002200;">+</span><span style="color: #2400d9;">2</span><span style="color: #002200;">+</span><span style="color: #2400d9;">8</span><span style="color: #002200;">&#41;</span>;</pre></div></div>

<p>And the &#8220;meat&#8221; of the code: the chunk that implements the custom back-testing to:</p>
<ol>
<li>Loop through the signals and store the Entry ATR value.</li>
<li>Loop through all trades and retrieve MFE, MAE and ATR.</li>
<li>Compute the e-ratio based on values from all trades.</li>
</ol>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">SetCustomBacktestProc<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;&quot;</span><span style="color: #002200;">&#41;</span>; <span style="color: #11740a; font-style: italic;">//activate the custom backtester</span>
<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>Status<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;action&quot;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">==</span> actionPortfolio<span style="color: #002200;">&#41;</span> <span style="color: #11740a; font-style: italic;">//called when backtesting/optimising</span>
<span style="color: #002200;">&#123;</span>
	bo <span style="color: #002200;">=</span> GetBacktesterObject<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;
	bo.PreProcess<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>; <span style="color: #11740a; font-style: italic;">// run default backtest procedure</span>
	TradeATR <span style="color: #002200;">=</span> NumTrades <span style="color: #002200;">=</span> ATRArr <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>; <span style="color: #11740a; font-style: italic;">//init variables</span>
	<span style="color: #a61390;">for</span><span style="color: #002200;">&#40;</span> bar<span style="color: #002200;">=</span><span style="color: #2400d9;">0</span>; bar &lt; BarCount<span style="color: #002200;">-</span><span style="color: #2400d9;">1</span>; bar<span style="color: #002200;">++</span><span style="color: #002200;">&#41;</span>
	<span style="color: #002200;">&#123;</span>
		bo.ProcessTradeSignals<span style="color: #002200;">&#40;</span>bar<span style="color: #002200;">&#41;</span>;
&nbsp;
		<span style="color: #a61390;">for</span> <span style="color: #002200;">&#40;</span> sig<span style="color: #002200;">=</span>bo.GetFirstSignal<span style="color: #002200;">&#40;</span>bar<span style="color: #002200;">&#41;</span>; sig; sig<span style="color: #002200;">=</span>bo.GetNextSignal<span style="color: #002200;">&#40;</span>bar<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#41;</span>
		<span style="color: #002200;">&#123;</span>
			<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>sig.isEntry<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>
			<span style="color: #002200;">&#123;</span>
				NumTrades<span style="color: #002200;">++</span>;
				ATRArr <span style="color: #002200;">=</span> Foreign<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;~atr_&quot;</span><span style="color: #002200;">+</span>sig.Symbol, <span style="color: #bf1d1a;">&quot;C&quot;</span><span style="color: #002200;">&#41;</span>;
				VarSet<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;TradeATR&quot;</span> <span style="color: #002200;">+</span> NumTrades, ATRArr<span style="color: #002200;">&#91;</span>bar<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
				_TRACE<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;Symbol &quot;</span> <span style="color: #002200;">+</span> sig.Symbol <span style="color: #002200;">+</span> <span style="color: #bf1d1a;">&quot; ATR: &quot;</span> <span style="color: #002200;">+</span> VarGet<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;TradeATR&quot;</span> <span style="color: #002200;">+</span> NumTrades<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
			<span style="color: #002200;">&#125;</span>
		<span style="color: #002200;">&#125;</span>
	<span style="color: #002200;">&#125;</span>
&nbsp;
	AvgMAE <span style="color: #002200;">=</span> AccumMAE <span style="color: #002200;">=</span> AvgMFE <span style="color: #002200;">=</span> AccumMFE <span style="color: #002200;">=</span> NumTrades <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;
&nbsp;
	<span style="color: #11740a; font-style: italic;">// iterate through closed trades</span>
	<span style="color: #a61390;">for</span><span style="color: #002200;">&#40;</span> trade <span style="color: #002200;">=</span> bo.GetFirstTrade<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>; trade; trade <span style="color: #002200;">=</span> bo.GetNextTrade<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#41;</span>
	<span style="color: #002200;">&#123;</span>
		NumTrades<span style="color: #002200;">++</span>;
		EntryATR <span style="color: #002200;">=</span> VarGet <span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;TradeATR&quot;</span> <span style="color: #002200;">+</span> NumTrades<span style="color: #002200;">&#41;</span>;
		<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span> EntryATR <span style="color: #002200;">!=</span> <span style="color: #2400d9;">0</span> <span style="color: #002200;">&#41;</span>
		<span style="color: #002200;">&#123;</span>
			_TRACE<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;EntryATR: &quot;</span> <span style="color: #002200;">+</span> WriteVal<span style="color: #002200;">&#40;</span>EntryATR<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
			_TRACE<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;AccumMAE : &quot;</span> <span style="color: #002200;">+</span> WriteVal<span style="color: #002200;">&#40;</span>AccumMAE<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
			AccumMAE <span style="color: #002200;">=</span> AccumMAE <span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span>trade.GetMAE<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">*</span>trade.EntryPrice<span style="color: #002200;">/</span><span style="color: #002200;">&#40;</span><span style="color: #2400d9;">100</span><span style="color: #002200;">*</span>EntryATR<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
			AccumMFE <span style="color: #002200;">=</span> AccumMFE <span style="color: #002200;">+</span> <span style="color: #002200;">&#40;</span>trade.GetMFE<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">*</span>trade.EntryPrice<span style="color: #002200;">/</span><span style="color: #002200;">&#40;</span><span style="color: #2400d9;">100</span><span style="color: #002200;">*</span>EntryATR<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
		<span style="color: #002200;">&#125;</span>
&nbsp;
		trade.AddCustomMetric<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;My MAE&quot;</span>, trade.GetMAE<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">*</span>trade.EntryPrice<span style="color: #002200;">/</span><span style="color: #2400d9;">100</span><span style="color: #002200;">&#41;</span>;
		trade.AddCustomMetric<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;My MFE&quot;</span>, trade.GetMFE<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">*</span>trade.EntryPrice<span style="color: #002200;">/</span><span style="color: #2400d9;">100</span><span style="color: #002200;">&#41;</span>;
		trade.AddCustomMetric<span style="color: #002200;">&#40;</span><span style="color: #bf1d1a;">&quot;Entry ATR&quot;</span>, EntryATR<span style="color: #002200;">*</span><span style="color: #2400d9;">10000</span><span style="color: #002200;">&#41;</span>;
	<span style="color: #002200;">&#125;</span>
&nbsp;
	AvgMAE <span style="color: #002200;">=</span> AccumMAE <span style="color: #002200;">/</span> NumTrades;
	AvgMFE <span style="color: #002200;">=</span> AccumMFE <span style="color: #002200;">/</span> NumTrades;
&nbsp;
	_TRACE<span style="color: #002200;">&#40;</span>WriteVal<span style="color: #002200;">&#40;</span>AccumMAE <span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
	_TRACE<span style="color: #002200;">&#40;</span>WriteVal<span style="color: #002200;">&#40;</span>NumTrades<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
	_TRACE<span style="color: #002200;">&#40;</span>WriteVal<span style="color: #002200;">&#40;</span>AvgMAE<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
	Eratio <span style="color: #002200;">=</span> <span style="color: #a61390;">abs</span><span style="color: #002200;">&#40;</span>AvgMFE<span style="color: #002200;">/</span>AvgMAE<span style="color: #002200;">&#41;</span>;
&nbsp;
	_TRACE<span style="color: #002200;">&#40;</span>WriteVal<span style="color: #002200;">&#40;</span>Eratio<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
&nbsp;
	bo.AddCustomMetric<span style="color: #002200;">&#40;</span> <span style="color: #bf1d1a;">&quot;Avg MAE&quot;</span>, AvgMAE <span style="color: #002200;">&#41;</span>;
	bo.AddCustomMetric<span style="color: #002200;">&#40;</span> <span style="color: #bf1d1a;">&quot;Avg MFE&quot;</span>, AvgMFE <span style="color: #002200;">&#41;</span>;
	bo.AddCustomMetric<span style="color: #002200;">&#40;</span> <span style="color: #bf1d1a;">&quot;Eratio&quot;</span>, Eratio<span style="color: #002200;">&#41;</span>;
&nbsp;
	bo.PostProcess<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>If you want to run this code, you can download the <a href="http://www.automated-trading-system.com/wp-content/uploads/2009/11/e-ratio-gorilla.afl" target="_blank">e-ratio &#8220;gorilla&#8221; afl file</a> and simply update the BUY signals to whatever you fancy testing.</p>
<p>The next post will be a direct speed comparison between TradersStudio and Amibroker for computing the e-ratio on the same underlying data and with the same signal. I expect Amibroker to <em>win the fight</em> hands-down as it appeared &#8220;way&#8221; faster!</p>
<img src="http://www.automated-trading-system.com/?ak_action=api_record_view&id=901&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.automated-trading-system.com/amibroker-tradersstudio-speed-comparison/' rel='bookmark' title='Permanent Link: Amibroker V. TradersStudio: Speed comparison Fight'>Amibroker V. TradersStudio: Speed comparison Fight</a></li>
<li><a href='http://www.automated-trading-system.com/amibroker-v-tradersstudio-comparison/' rel='bookmark' title='Permanent Link: Amibroker vs TradersStudio: comparison'>Amibroker vs TradersStudio: comparison</a></li>
<li><a href='http://www.automated-trading-system.com/e-ratio-tradersstudio-excel/' rel='bookmark' title='Permanent Link: e-ratio calculation in TradersStudio and Excel'>e-ratio calculation in TradersStudio and Excel</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/e-ratio-amibroker-code/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>e-ratio calculation in TradersStudio and Excel</title>
		<link>http://www.automated-trading-system.com/e-ratio-tradersstudio-excel/</link>
		<comments>http://www.automated-trading-system.com/e-ratio-tradersstudio-excel/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 10:31:48 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[e-ratio]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[tradersstudio]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=810</guid>
		<description><![CDATA[Here is one method to implement an e-ratio calculation.
As we say in developerspeak, the following is a quick and dirty approach to calculating the e-ratio. But as far as I am concerned, it does the job! It can probably be programmed more elegantly in TradersStudio but I still have to climb some of that software [...]


Related posts:<ol><li><a href='http://www.automated-trading-system.com/e-ratio-amibroker-code/' rel='bookmark' title='Permanent Link: Amibroker e-ratio code'>Amibroker e-ratio code</a></li>
<li><a href='http://www.automated-trading-system.com/amibroker-tradersstudio-speed-comparison/' rel='bookmark' title='Permanent Link: Amibroker V. TradersStudio: Speed comparison Fight'>Amibroker V. TradersStudio: Speed comparison Fight</a></li>
<li><a href='http://www.automated-trading-system.com/e-ratio-trading-edge/' rel='bookmark' title='Permanent Link: e-ratio: How to measure your trading edge in 4 easy steps'>e-ratio: How to measure your trading edge in 4 easy steps</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here is one method to implement an <a href="http://www.automated-trading-system.com/e-ratio-trading-edge/">e-ratio</a> calculation.<br />
As we say in <em>developerspeak</em>, the following is a <em>quick and dirty</em> approach to calculating the e-ratio. But as far as I am concerned, it does the job! It can probably be programmed more elegantly in TradersStudio but I still have to climb some of that software learning curve&#8230;</p>
<p>I will show you how I calculated the e-ratio for a 17-day Donchian Channel breakout coupled with <span id="more-810"></span>a 108-day moving average filter (the red curve on <a href="http://www.automated-trading-system.com/e-ratio-trading-edge#e-ratio-filter-chart">this chart</a>). All the code referenced is provided at the end of this post.</p>
<p>As we saw in the <a href="http://www.automated-trading-system.com/e-ratio-trading-edge/">last post about the e-ratio</a>, you need to run the same signal over multiple fixed trade durations and record trade data. For this the TradersStudio optimisation and custom reports functionalities fit the bill.</p>
<h3>System Code</h3>
<h4>Step 1: code up the system to test in TraderStudio</h4>
<p>As you can not have simultaneous open Buy and Sell positions, there are actually 2 systems (long-only and short-only). The below will be based on the Buy-only system.<br />
The entry signal is a breakout of the Donchian channel if the MA filter conditions are met (price > MA and MA rising).<br />
In TradersStudio this translates to:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">MA = ScriptAve(<span style="color: #000080;">Close</span>, MALength,0)
<span style="color: #000080;">If</span> MA &gt; MA[1] <span style="color: #000080;">And</span> <span style="color: #000080;">Close</span> &gt; MA <span style="color: #000080;">Then</span> 
    Buy(EntryName,1,donchianHigh+MinMove ,<span style="color: #000080;">Stop</span>,Day)
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span></pre></div></div>

<p>The exit is simple: close the trade after <em>n</em> days (tradeLength):</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">If</span> BarsSinceEntry=tradeLength <span style="color: #000080;">And</span> MarketPosition=1 <span style="color: #000080;">Then</span> 
    ExitLong(<span style="color: #800000;">&quot;ExitLong&quot;</span>,EntryName,1,0,CloseExit,Day)
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span></pre></div></div>

<h4>Step 2: retrieve trade data in custom report</h4>
<p>As discussed in the e-ratio post we need to get MAE, MFE and ATR for each trade. For this we use a TradersStudio custom report. The report code is executed at the end of the system test and retrieve trade info with the following command:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">GetInfoAboutTrades(Info, i + 1)</pre></div></div>

<p>we are interested in the MAE and MFE which can be derived off the Maximum Profit and Maximum Loss of each trade:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">SetCell(row, 13, 2, 10, Info[16]) <span style="color: #008000;">'Max Pos Profit
</span>SetCell(row, 14, 2, 10, Info[17]) 'Max Pos Loss</pre></div></div>

<p>For the ATR value, we need to use a little trick as it is not directly available. We record it as part of the entry name which can be output to the report.<br />
In the system code we have:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">EntryName = <span style="color: #800000;">&quot;DonchianBreakoutBuy&quot;</span> + <span style="color: #800000;">&quot;|&quot;</span> + indLength + <span style="color: #800000;">&quot;|&quot;</span> + tradeLength  + <span style="color: #800000;">&quot;|&quot;</span> + avgtruerange(indLength)</pre></div></div>

<p>which concatenates the entry name with the ATR value as well as the length of the indicator (Donchian Channel) and trade duration &#8211; this will come in handy when we do the e-ratio calculation.</p>
<h4>Step 3: run the system through the optimizer</h4>
<p>The system is called DonchianChanBrkoutFiltBuy and has 3 parameters:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Sub</span> DonchianChanBrkoutFiltBuy(indLength, tradeLength, MALength)</pre></div></div>

<p>In the optimization process, step through all values of trade duration required (e.g from 1 to 100 in increments of 1) &#8211; warning TradersStudio will take a few hours to do this (sic!).<br />
This will generate a custom trade report for all trades containing all the data required.</p>
<h4>Step 4: paste data in Excel</h4>
<p>Once you run the long-only and short-only systems, we are done with TradersStudio. We need to move the data over to Excel for analysis and the e-ratio computation.<br />
Copy the custom trade report from the short-only system run to one sheet and from the long-only run to another sheet (watch out for the number of rows: if you have more than 65,536 and a version of Excel earlier than 2007 you will need to do that in several chunks).</p>
<h4>Step 5: Run e-ratio macro</h4>
<p>Copy the macro code from the text file, create a new VBA module in Excel and paste the code in it.<br />
Go back to both sheets and run the macro. This should manipulate the data and create an aggregation pivot table on a separate sheet.</p>
<h4>Step 6: Compute the e-ratio</h4>
<p>On a brand new sheet, copy both pivot tables (I recommend a paste/special &#8211; values only) side by side so that each trade length values corespond with each other. Sum each Total value (column D and J) together for the same Buy and Sell parameters (in column N in example file). Divide each Sum of MFE by Sum of MAE: this gives you the e-ratio for the given trade length.</p>
<h3>THE CODE</h3>
<p>Please find below code files to support the example below (all txt files except the Excel workbook). This should be easily portable to any system (i.e. just change entry criteria in the system).<br />
<a href="http://www.automated-trading-system.com/wp-content/uploads/2009/10/e-ratio/DonchianChannel.txt" target="_blank">Donchian Channel Indicator</a><br />
<a href="http://www.automated-trading-system.com/wp-content/uploads/2009/10/e-ratio/MyCustomTBT.txt" target="_blank">Custom trade Report</a><br />
<a href="http://www.automated-trading-system.com/wp-content/uploads/2009/10/e-ratio/DonchianChanBrkoutFiltBuy.txt" target="_blank">Buy System</a><br />
<a href="http://www.automated-trading-system.com/wp-content/uploads/2009/10/e-ratio/DonchianChanBkoutFiltSell.txt" target="_blank">Sell System</a><br />
<a href="http://www.automated-trading-system.com/wp-content/uploads/2009/10/e-ratio/e-ratio XL macro.txt" target="_blank">Excel e-ratio macro (text file)</a><br />
<a href="http://www.automated-trading-system.com/wp-content/uploads/2009/10/e-ratio/Sample e-ratio calc.xls" target="_blank">Excel example workbook</a> (does not contain underlying raw data as it is 60MB!)</p>
<p>Or if you prefer a zipped version of all files &#8211; <a href="http://www.automated-trading-system.com/wp-content/uploads/2009/10/e-ratio/e-ratio.zip" target="_blank">here it is</a>.</p>
<p>Any questions, clarifications, etc. please let me know how I can help.</p>
<img src="http://www.automated-trading-system.com/?ak_action=api_record_view&id=810&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.automated-trading-system.com/e-ratio-amibroker-code/' rel='bookmark' title='Permanent Link: Amibroker e-ratio code'>Amibroker e-ratio code</a></li>
<li><a href='http://www.automated-trading-system.com/amibroker-tradersstudio-speed-comparison/' rel='bookmark' title='Permanent Link: Amibroker V. TradersStudio: Speed comparison Fight'>Amibroker V. TradersStudio: Speed comparison Fight</a></li>
<li><a href='http://www.automated-trading-system.com/e-ratio-trading-edge/' rel='bookmark' title='Permanent Link: e-ratio: How to measure your trading edge in 4 easy steps'>e-ratio: How to measure your trading edge in 4 easy steps</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/e-ratio-tradersstudio-excel/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>TradersStudio: the best Systems testing software?</title>
		<link>http://www.automated-trading-system.com/tradersstudio-systems-testing-software/</link>
		<comments>http://www.automated-trading-system.com/tradersstudio-systems-testing-software/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 09:45:48 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[CSI]]></category>
		<category><![CDATA[tradersstudio]]></category>
		<category><![CDATA[tradestation]]></category>
		<category><![CDATA[Unfair Advantage]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=642</guid>
		<description><![CDATA[I should say &#8220;Yes&#8221; as I decided to purchase, and now own TradersStudio. For the price ($499), it offers a very decent package for developing and testing automated trading systems.
Why I chose TradersStudio
I did consider a few options before buying TradersStudio (Amibroker, TradeStation, Trading Blox, WealthLab, NinjaTrader) and based on feature analysis, recommendations and actual [...]


Related posts:<ol><li><a href='http://www.automated-trading-system.com/amibroker-v-tradersstudio-comparison/' rel='bookmark' title='Permanent Link: Amibroker vs TradersStudio: comparison'>Amibroker vs TradersStudio: comparison</a></li>
<li><a href='http://www.automated-trading-system.com/amibroker-tradersstudio-speed-comparison/' rel='bookmark' title='Permanent Link: Amibroker V. TradersStudio: Speed comparison Fight'>Amibroker V. TradersStudio: Speed comparison Fight</a></li>
<li><a href='http://www.automated-trading-system.com/backtesting-trading-platform/' rel='bookmark' title='Permanent Link: How to decide on a Backtesting and Trading Platform'>How to decide on a Backtesting and Trading Platform</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I should say &#8220;Yes&#8221; as I decided to purchase, and now own TradersStudio. For the price ($499), it offers a very decent package for developing and testing automated trading systems.</p>
<h3>Why I chose TradersStudio</h3>
<p>I did consider a few options before buying <a href="http://www.tradersstudio.com/" target="_blank" rel="nofollow">TradersStudio</a> (Amibroker, TradeStation, Trading Blox, WealthLab, NinjaTrader) and based on feature analysis, recommendations and actual testing, I settled on TradersStudio.<br />
My requirements were for a standalone platform that would allow me to test any system, with money management and multiple system interaction.<br />
I did hesitate with Trading Blox, which I enjoyed testing (demo version), but in the end the price sorted the argument (Trading Blox is $3,000 for similar functionality).<br />
For more info on what each product offers, I would definitely recommend heading to <a href="http://www.elitetrader.com/" target="_blank" rel="nofollow">EliteTrader</a> where many platform comparison posts can be found. Please also feel free to ask me questions in the Comments section below.</p>
<h3>First impressions</h3>
<p>Not so good&#8230; There is no<span id="more-642"></span> demo available on the website, you can not download the app from the website once purchased and the manuals you receive after waiting a few days seem quite unprofessional (despite being over 300 pages).<br />
However, the install is quite easy and you can be up and running following examples from the manual in a few minutes.</p>
<h3>Main Features</h3>
<p>The app offers some interesting features which help me take the decision:</p>
<h3>Integrated Systems testing</h3>
<p>TradersStudio uses different hierarchical levels: Instrument, System, Session, Trade Plan. This allows you to test a <em>complete</em> system (i.e. more than simple entry and exit testing). A Trade Plan can contain several sessions, which in turn can contain several systems and instruments with possible interaction between them. Additionally, Money Management options can be tested as part of the Trading Plan. This makes it much more realistic than a collection of independent strategy tests.<br />
There is also to the concept of <em>virtual systems</em> that allow you to run a system in &#8220;monitor&#8221; mode and only use it for decision making on other &#8220;live&#8221; systems (i.e. enter a trade in real system only after virtual system posts 3 losing trades).</p>
<h3>Customisation</h3>
<p>TradersStudio implements its own Macro language, which appears to be a cross between TradeStation EasyLanguage and Visual Basic. Theoritically you can implement whatever extra functionality you require (indicator, software add-in, etc.). Moreover there is an import tool that automatically converts TradeStation EasyLanguage code, which should allow to reuse available code.</p>
<h3>Data-independent</h3>
<p>You can basically load data from whatever source you wish in any supported format (any standard text file format will do). I personally use Unfair Advantage from CSI and getting it loaded to TradersStudio was a breeze (see <a href="http://www.automated-trading-system.com/tag/unfair-advantage/">Unfair Advantage posts</a> for more information on CSI UA -> TradersStudio)</p>
<h3>Walk Forward</h3>
<p>Walk forward is a useful concept to use in back-testing to avoid over-optimization and curve-fitting. TradersStudio implements this functionality and runs it automatically which means less manual workaround for you to deal with.</p>
<h3>Documentation issues</h3>
<p>My main grudge is about the manuals. Despite being over 300 pages it is still missing an essential reference guide for programming using their language (there are a few examples but they do not cover the whole range of functionality and much is left to be guessed by the user). It is a &#8220;Learning by Example&#8221; type of manual which can sound a bit patronising at times.<br />
For that reason I have found it hard to seriously get into TradersStudio&#8230; but I have just signed up for the yahoo group dedicated to it and will be spending many hours in front of it very soon!</p>
<p>I will explore TradersStudio in more details as I start using it and share in a later post if you are interested.</p>
<img src="http://www.automated-trading-system.com/?ak_action=api_record_view&id=642&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.automated-trading-system.com/amibroker-v-tradersstudio-comparison/' rel='bookmark' title='Permanent Link: Amibroker vs TradersStudio: comparison'>Amibroker vs TradersStudio: comparison</a></li>
<li><a href='http://www.automated-trading-system.com/amibroker-tradersstudio-speed-comparison/' rel='bookmark' title='Permanent Link: Amibroker V. TradersStudio: Speed comparison Fight'>Amibroker V. TradersStudio: Speed comparison Fight</a></li>
<li><a href='http://www.automated-trading-system.com/backtesting-trading-platform/' rel='bookmark' title='Permanent Link: How to decide on a Backtesting and Trading Platform'>How to decide on a Backtesting and Trading Platform</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/tradersstudio-systems-testing-software/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Are you reading the essential books?</title>
		<link>http://www.automated-trading-system.com/essential-trading-books/</link>
		<comments>http://www.automated-trading-system.com/essential-trading-books/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 11:06:37 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Books]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Money Management]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Strategies]]></category>
		<category><![CDATA[Trend Following]]></category>
		<category><![CDATA[library]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=386</guid>
		<description><![CDATA[I am bit of a geek and this is especially true when it comes to books. I firmly believe in self-development and I think books are a great medium to learn many things. Ok, the internet is so great to learn about new things; but nothing beats a good in-depth book(s) to really learn a [...]


Related posts:<ol><li><a href='http://www.automated-trading-system.com/weekend-reading/' rel='bookmark' title='Permanent Link: Weekend reading'>Weekend reading</a></li>
<li><a href='http://www.automated-trading-system.com/practical-guide-to-etf-trading-systems-garner/' rel='bookmark' title='Permanent Link: A practical Guide to ETF Trading Systems'>A practical Guide to ETF Trading Systems</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I am bit of a geek and this is especially true when it comes to books. I firmly believe in self-development and I think books are a great medium to learn many things. Ok, the internet is so great to learn <em>about</em> new things; but nothing beats a good in-depth book(s) to really learn a subject by yourself.</p>
<p>This is the list of my real-life library dedicated to building automated trading systems. This is not the exhaustive list: I have more specialised books which I will add at a later stage (some I have not read yet&#8230;). But the collection below is a decent starting list:</p>
<p>Please feel free to suggest your book recommendations or any additional info using the comments section below.</p>
<p>Please find below the Library organised in several sections:</p>
<ul>
<li><a href="http://www.automated-trading-system.com/essential-trading-books/#TradingSystems" style="text-decoration:none; color:black;"><strong>TRADING SYSTEMS</strong></a></li>
<li><a href="http://www.automated-trading-system.com/essential-trading-books/#MoneyManagement" style="text-decoration:none; color:black;"><strong>MONEY MANAGEMENT</strong></a></li>
<li><a href="http://www.automated-trading-system.com/essential-trading-books/#TrendFollowing" style="text-decoration:none; color:black;"><strong>TREND FOLLOWING</strong></a></li>
<li><a href="http://www.automated-trading-system.com/essential-trading-books/#TradersInsights" style="text-decoration:none; color:black;"><strong>TRADERS INSIGHTS</strong></a></li>
<li><a href="http://www.automated-trading-system.com/essential-trading-books/#MarketsRiskChance" style="text-decoration:none; color:black;"><strong>MARKETS, RISK AND CHANCE</strong></a></li>
<li><a href="http://www.automated-trading-system.com/essential-trading-books/#Other" style="text-decoration:none; color:black;"><strong>OTHER</strong></a></li>
</ul>
<p><span id="more-386"></span></p>
<div style="line-height:125%;">
<table>
<tr>
<td colspan="2" style="padding-left:10px; padding-top:20px; padding-bottom:20px; font-size:1.4em;">
      <a name="TradingSystems" style="text-decoration:none; color:grey;"><strong>&#8211; TRADING SYSTEMS &#8211;</strong></a>
    </td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/new-trading-systems-and-methods-kaufman_small.jpg">
    </td>
<td valign="top">
      <strong>New Trading Systems and Methods &#8211; Perry Kaufman</strong><br />
      <em>An encyclopedic (1,000+ pages) review of Systems Ideas and Methods</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/047126847X/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/047126847X/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/047126847X/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/quality-money-management-vanvliet-kumiega_small.jpg">
    </td>
<td valign="top">
      <strong>Quality Money Management &#8211; Benjamin Van Vliet &#038; Andrew Kumiega</strong><br />
      <em>Best practices in Systematic Trading Technology. Build it with Quality!</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0123725496/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0123725496/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0123725496/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/Trading-Systems-Money-Management-Stridsman_small.jpg">
    </td>
<td valign="top">
      <strong>Trading Systems and Money Management &#8211; Thomas Stridsman</strong><br />
      <em>Presents a strong approach to developing Trading Systems integrating Money Management concepts</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0071400192/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.com/exec/obidos/ASIN/0071400192/autotradblog-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0071400192/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr>
<td colspan="2" style="padding-left:10px; padding-top:20px; padding-bottom:20px; font-size:1.4em;">
      <a name="MoneyManagement" style="text-decoration:none; color:grey;"><strong>&#8211; MONEY MANAGEMENT &#8211;</strong></a>
    </td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/balsara_small.jpg">
    </td>
<td valign="top">
      <strong>Money Management Strategies for Futures Traders &#8211; Nauzer Balsara</strong><br />
      <em>Complete introduction to the essential concept of Money Management.</em><br />
      <span style="line-height:200%;"><a href="http://www.automated-trading-system.com/balsara-money-management-strategies-for-futures-traders/">Check my review/summary</a><br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0471522155/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0471522155/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0471522155/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/handbook-portfolio-mathematics-vince_small.jpg">
    </td>
<td valign="top">
      <strong>The Handbook of Portfolio Mathematics &#8211; Ralph Vince</strong><br />
      <em>Essential reading for Optimal Allocations and Leverage!</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0471757683/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0471757683/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0471757683/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr>
<td colspan="2" style="padding-left:10px; padding-top:20px; padding-bottom:20px; font-size:1.4em;">
      <a name="TrendFollowing" style="text-decoration:none; color:grey;"><strong>&#8211; TREND FOLLOWING &#8211;</strong></a>
    </td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/trend-following-covel_small.jpg">
    </td>
<td valign="top">
      <strong>Trend Following &#8211; Michael Covel</strong><br />
      <em>See Why and How Trend Following works. Over a dozen of top CTAs covered.</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/013702018X/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/013702018X/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/013702018X/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/The-Complete-Turtle-Trader-Covel_small.jpg">
    </td>
<td valign="top">
      <strong>The Complete Turtle Trader &#8211; Michael Covel</strong><br />
      <em>The Turtle story and their complete rules</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0061241717/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0061241709/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0061241709/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/Way-of-the-Turtle-Faith_small.jpg">
    </td>
<td valign="top">
      <strong>Way of the Turtle &#8211; Curtis Faith</strong><br />
      <em>The Turtle experiment from the inside &#8211; told by a Turtle!</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/007148664X/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/007148664X/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/007148664X/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr>
<td colspan="2" style="padding-left:10px; padding-top:20px; padding-bottom:20px; font-size:1.4em;">
      <a name="TradersInsights" style="text-decoration:none; color:grey;"><strong>&#8211; TRADERS INSIGHTS &#8211;</strong></a>
    </td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/Market-Wizards-Schwager_small.jpg">
    </td>
<td valign="top">
      <strong>Market Wizards &#8211; Jack Schwager</strong><br />
      <em>Legendary interviews of top traders. Inspirational and &#8220;motivation-kicker&#8221;!</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/1592802974/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/1592802974/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/1592802974/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/New-Market-Wizards-Schwager_small.jpg">
    </td>
<td valign="top">
      <strong>The New Market Wizards &#8211; Jack Schwager</strong><br />
      <em>Schwager strikes back! You&#8217;ll re-read him often.</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/1592803377/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/1592803377/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0887306675/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr>
<td colspan="2" style="padding-left:10px; padding-top:20px; padding-bottom:20px; font-size:1.4em;">
      <a name="MarketsRiskChance" style="text-decoration:none; color:grey;"><strong>&#8211; MARKETS, RISK AND CHANCE &#8211;</strong></a>
    </td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/(mis)behavior-of-markets-mandelbrot_small.jpg">
    </td>
<td valign="top">
      <strong>The (mis)behavior of Markets &#8211; Benoit Mandelbrot</strong><br />
      <em>A fractal view of Risk, Ruin and Reward</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0465043577/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0465043577/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0465043550/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/black-swan-taleb_small.jpg">
    </td>
<td valign="top">
      <strong>The Black Swan &#8211; Nasim Taleb</strong><br />
      <em>Taleb re-writes the rules of risk. An excellent perspective on conventionally accepted concepts</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/1400063515/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/1400063515/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0141034599/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/fooled-by-randomness-taleb_small.jpg">
    </td>
<td valign="top">
      <strong>Fooled by Randomness &#8211; Nasim Taleb</strong><br />
      <em>The hidden role of Chance in Life and the Markets</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/1400067936/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0812975219/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0141031484/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/drunkards-walk-mlodinow_small.jpg">
    </td>
<td valign="top">
      <strong>The Drunkard&#8217;s Walk &#8211; Leonard Mlodinow</strong><br />
      <em>The hidden role of Chance in Life and the Markets</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0307275175/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0307275175/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0141026472/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/random-walk-down-wall-street-malkiel_small.jpg">
    </td>
<td valign="top">
      <strong>A Random Walk Down Wall Street &#8211; Burton Malkiel</strong><br />
      <em>The original classic claiming Efficiency in the Markets</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0393330338/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0393330338/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0393062457/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/non-random-walk-down-wall-street-lo-mackinlay_small.jpg">
    </td>
<td valign="top">
      <strong>A Non-Random Walk Down Wall Street &#8211;  Andrew lo &#038; Craig MacKinlay</strong><br />
      <em>Collection of academic papers on Efficiency Market Theory</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0691092567/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0691092567/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0691092567/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/when-genius-failed-lowenstein_small.jpg">
    </td>
<td valign="top">
      <strong>When Genius Failed &#8211; Roger Lowenstein</strong><br />
      <em>How mis-understanding of Risk and Money Management drove LTCM to their graves. Fascinating!</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0375758259/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0375758259/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/1841155047/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr>
<td colspan="2" style="padding-left:10px; padding-top:20px; padding-bottom:20px; font-size:1.4em;">
      <a name="Other" style="text-decoration:none; color:grey;"><strong>&#8211; OTHER &#8211;</strong></a>
    </td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/Schwager-on-Futures-Managed-Trading_small.jpg">
    </td>
<td valign="top">
      <strong>Schwager on Futures Managed Trading &#8211; Jack Schwager</strong><br />
      <em>In-depth investigation into the Managed Futures/CTA industry</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0471020575/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0471020575/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0471020575/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/starting-out-in-futures-trading-powers_small.jpg">
    </td>
<td valign="top">
      <strong>Starting Out in Futures Trading &#8211; Mark Powers</strong><br />
      <em>Learn the ropes of Futures Trading: a Beginner&#8217;s reference.</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/0071363904/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/0071363904/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/0071363904/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
<tr height="10">
<td colspan="2"></td>
</tr>
<tr>
<td valign="top" align="center">
      <img src="http://www.automated-trading-system.com/wp-content/uploads/library/images/book-covers/small/demark-indicators-perl_small.jpg">
    </td>
<td valign="top">
      <strong>DeMark Indicators Jason Perl</strong><br />
      <em>The clearest presentation of all TD indicators</em><br />
      <span style="line-height:200%;">&#8211;No review/summary yet&#8211;<br /></span>Look up on Amazon <a href="http://www.amazon.com/exec/obidos/ASIN/1576603148/autotradblog-20" target="_blank" rel="nofollow">US</a> | <a href="http://www.amazon.ca/exec/obidos/ASIN/1576603148/autotradblo02-20" target="_blank" rel="nofollow">CA</a> | <a href="http://www.amazon.co.uk/exec/obidos/ASIN/1576603148/autotradblo01-21" target="_blank" rel="nofollow">UK</a>
    </td>
</tr>
</table>
</div>
<img src="http://www.automated-trading-system.com/?ak_action=api_record_view&id=386&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.automated-trading-system.com/weekend-reading/' rel='bookmark' title='Permanent Link: Weekend reading'>Weekend reading</a></li>
<li><a href='http://www.automated-trading-system.com/practical-guide-to-etf-trading-systems-garner/' rel='bookmark' title='Permanent Link: A practical Guide to ETF Trading Systems'>A practical Guide to ETF Trading Systems</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/essential-trading-books/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unfair Advantage API: Retrieve Back-Adjusted Contracts function</title>
		<link>http://www.automated-trading-system.com/unfair-advantage-api-retrieve-back-adjusted-contracts-function/</link>
		<comments>http://www.automated-trading-system.com/unfair-advantage-api-retrieve-back-adjusted-contracts-function/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 10:41:06 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Futures]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Continuous contract]]></category>
		<category><![CDATA[CSI]]></category>
		<category><![CDATA[Unfair Advantage]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=202</guid>
		<description><![CDATA[Let&#8217;s have fun with the CSI UA API!
CSI main API document (word doc) is accessible publicly online from their document page along with other docs including the full 300 page manual (great for getting a feel of the app).
Pivotal API function
This post will focus on is the API function to retrieve Back-Adjusted Contracts from the [...]


Related posts:<ol><li><a href='http://www.automated-trading-system.com/unfair-advantage-api-code-c-extract-futures-continuous-data/' rel='bookmark' title='Permanent Link: Unfair Advantage API Code (C#): Extract Futures Continuous data'>Unfair Advantage API Code (C#): Extract Futures Continuous data</a></li>
<li><a href='http://www.automated-trading-system.com/continuous-contract-options/' rel='bookmark' title='Permanent Link: Continuous Contract options'>Continuous Contract options</a></li>
<li><a href='http://www.automated-trading-system.com/unfair-advantage-csi/' rel='bookmark' title='Permanent Link: I just got myself an Unfair Advantage&#8230;'>I just got myself an Unfair Advantage&#8230;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s have fun with the CSI UA API!<img class="size-full wp-image-251" title="CSI-Unfair-Advantage-API" src="http://www.automated-trading-system.com/wp-content/uploads/2009/09/CSI-API1.jpg" alt="Let's have fun with the CSI UA API" width="450" height="185" /></p>
<p><a rel="nofollow" href="http://www.csidata.com/custserv/onlinehelp/uaapi/UaOleApi.doc" target="_blank">CSI main API document (word doc)</a> is accessible publicly online from their <a rel="nofollow" href="http://www.csidata.com/custserv/onlinehelp/index.html" target="_blank">document page</a> along with other docs including the full 300 page manual (great for getting a feel of the app).</p>
<h3>Pivotal API function</h3>
<p>This post will focus on is the API function to retrieve Back-Adjusted Contracts from the Unfair Advantage database.<br />
As the last post on <a href="http://www.automated-trading-system.com/continuous-contract-options/">Continuous Contract options</a> showed, there are multiple choices available and these all translate to parameters to <span id="more-202"></span>the API function: <strong>RetrieveBackAdjustedContract2</strong>. This is what I consider to be the <em>meat</em> of the API: it queries the proprietary UA database and applies the concatenation algorithms to produce a continuous contract.</p>
<h3>27 Parameters!</h3>
<p>Yes&#8230; that function&#8217;s behaviour is driven by the value of 27 properties or variables. There are actually 14 &#8220;Session&#8221; properties and another 13 variables passed to the function. The aim of these parameters is to reproduce exactly all the options covered in the previous post&#8230; and then some.</p>
<h3>My own doc</h3>
<p>Because I found the CSI doc not ideal (you have to keep flipping back and forth for a description of all 27 parameters) I decided to re-write my own &#8220;cheat-sheet&#8221; documentation for the <strong>RetrieveBackAdjustedContract2</strong> API function.<br />
The rest of this post is that document &#8211; formatted into HTML by M$ Word (so please excuse any formatting mishaps). The document contains 2 parts: the UA session properties and the function variables. Hope this helps.<br />
You can also <a href="http://www.automated-trading-system.com/wp-content/uploads/2009/09/CSI-UA-RetrieveBackAdjustedContract2-Doc.rtf" target="_blank">download the document in the RTF format.</a><br />
<a class="aligncenter href=" href="http://www.automated-trading-system.com/wp-content/uploads/2009/09/CSI-UA-RetrieveBackAdjustedContract2-Doc.rtf" target="_blank"><img class="aligncenter size-full wp-image-260" title="CSI UA API: RetrieveBackAdjustedContract2 function Cheat-Sheet" src="http://www.automated-trading-system.com/wp-content/uploads/2009/09/rtf_icon.png" alt="CSI UA API: RetrieveBackAdjustedContract2 function Cheat-Sheet" width="50" height="52" /></a></p>
<p>Stay tuned for the next episode, where I will share a sample code using the function above to extract a list of Futures contracts. This should illustrate how to use all these parameters.</p>
<h3>The document:</h3>
<h2>FUNCTION: RetrieveBackAdjustedContract2</h2>
<p><!--<br />
<!   /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-parent:""; 	margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Arial; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} h1 	{mso-style-next:Normal; 	margin-top:12.0pt; 	margin-right:0cm; 	margin-bottom:16.0pt; 	margin-left:0cm; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:1; 	font-size:16.0pt; 	font-family:Arial; 	mso-font-kerning:14.0pt; 	mso-fareast-language:EN-US;} h2 	{mso-style-next:Normal; 	margin-top:12.0pt; 	margin-right:0cm; 	margin-bottom:12.0pt; 	margin-left:0cm; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:2; 	font-size:14.0pt; 	font-family:Arial; 	mso-font-kerning:14.0pt; 	mso-fareast-language:EN-US; 	mso-bidi-font-style:italic;} h4 	{mso-style-next:Normal; 	margin-top:12.0pt; 	margin-right:0cm; 	margin-bottom:12.0pt; 	margin-left:0cm; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:4; 	font-size:11.0pt; 	mso-bidi-font-size:14.0pt; 	font-family:Arial; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} h5 	{mso-style-next:Normal; 	margin-top:12.0pt; 	margin-right:0cm; 	margin-bottom:6.0pt; 	margin-left:0cm; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:5; 	font-size:10.0pt; 	mso-bidi-font-size:13.0pt; 	font-family:Arial; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US; 	mso-bidi-font-style:italic;} h6 	{mso-style-next:Normal; 	margin-top:12.0pt; 	margin-right:0cm; 	margin-bottom:3.0pt; 	margin-left:0cm; 	mso-pagination:widow-orphan; 	page-break-after:avoid; 	mso-outline-level:6; 	font-size:10.0pt; 	mso-bidi-font-size:11.0pt; 	font-family:Arial; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} p.MsoHeader, li.MsoHeader, div.MsoHeader 	{margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:center 224.55pt right 449.9pt; 	font-size:10.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Arial; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} p.MsoFooter, li.MsoFooter, div.MsoFooter 	{margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	tab-stops:center 224.55pt right 449.9pt; 	font-size:8.0pt; 	mso-bidi-font-size:12.0pt; 	font-family:Arial; 	mso-fareast-font-family:"Times New Roman"; 	mso-bidi-font-family:"Times New Roman"; 	mso-fareast-language:EN-US;} span.MsoPageNumber 	{mso-ansi-font-size:8.0pt; 	font-family:Arial; 	mso-ascii-font-family:Arial; 	mso-hansi-font-family:Arial;} pre 	{margin:0cm; 	margin-bottom:.0001pt; 	mso-pagination:widow-orphan; 	font-size:10.0pt; 	font-family:"Courier New"; 	mso-fareast-font-family:"Times New Roman";} span.SpellE 	{mso-style-name:""; 	mso-spl-e:yes;} span.GramE 	{mso-style-name:""; 	mso-gram-e:yes;} @page Section1 	{size:595.3pt 841.9pt; 	margin:72.0pt 72.0pt 72.0pt 72.0pt; 	mso-header-margin:21.55pt; 	mso-footer-margin:21.55pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;}  /* List Definitions */  @list l0 	{mso-list-id:-132; 	mso-list-type:simple; 	mso-list-template-ids:1225576648;} @list l0:level1 	{mso-level-tab-stop:74.6pt; 	mso-level-number-position:left; 	margin-left:74.6pt; 	text-indent:-18.0pt;} @list l1 	{mso-list-id:-131; 	mso-list-type:simple; 	mso-list-template-ids:1309295544;} @list l1:level1 	{mso-level-tab-stop:60.45pt; 	mso-level-number-position:left; 	margin-left:60.45pt; 	text-indent:-18.0pt;} @list l2 	{mso-list-id:-130; 	mso-list-type:simple; 	mso-list-template-ids:1505632560;} @list l2:level1 	{mso-level-tab-stop:46.3pt; 	mso-level-number-position:left; 	margin-left:46.3pt; 	text-indent:-18.0pt;} @list l3 	{mso-list-id:-129; 	mso-list-type:simple; 	mso-list-template-ids:-1342289230;} @list l3:level1 	{mso-level-tab-stop:32.15pt; 	mso-level-number-position:left; 	margin-left:32.15pt; 	text-indent:-18.0pt;} @list l4 	{mso-list-id:-128; 	mso-list-type:simple; 	mso-list-template-ids:275296686;} @list l4:level1 	{mso-level-number-format:bullet; 	mso-level-text:\F0B7; 	mso-level-tab-stop:74.6pt; 	mso-level-number-position:left; 	margin-left:74.6pt; 	text-indent:-18.0pt; 	font-family:Symbol;} @list l5 	{mso-list-id:-127; 	mso-list-type:simple; 	mso-list-template-ids:472812886;} @list l5:level1 	{mso-level-number-format:bullet; 	mso-level-text:\F0B7; 	mso-level-tab-stop:60.45pt; 	mso-level-number-position:left; 	margin-left:60.45pt; 	text-indent:-18.0pt; 	font-family:Symbol;} @list l6 	{mso-list-id:-126; 	mso-list-type:simple; 	mso-list-template-ids:1685721214;} @list l6:level1 	{mso-level-number-format:bullet; 	mso-level-text:\F0B7; 	mso-level-tab-stop:46.3pt; 	mso-level-number-position:left; 	margin-left:46.3pt; 	text-indent:-18.0pt; 	font-family:Symbol;} @list l7 	{mso-list-id:-125; 	mso-list-type:simple; 	mso-list-template-ids:-1116197236;} @list l7:level1 	{mso-level-number-format:bullet; 	mso-level-text:\F0B7; 	mso-level-tab-stop:32.15pt; 	mso-level-number-position:left; 	margin-left:32.15pt; 	text-indent:-18.0pt; 	font-family:Symbol;} @list l8 	{mso-list-id:-120; 	mso-list-type:simple; 	mso-list-template-ids:779395724;} @list l8:level1 	{mso-level-tab-stop:18.0pt; 	mso-level-number-position:left; 	margin-left:18.0pt; 	text-indent:-18.0pt;} @list l9 	{mso-list-id:-119; 	mso-list-type:simple; 	mso-list-template-ids:-1209384448;} @list l9:level1 	{mso-level-number-format:bullet; 	mso-level-text:\F0B7; 	mso-level-tab-stop:18.0pt; 	mso-level-number-position:left; 	margin-left:18.0pt; 	text-indent:-18.0pt; 	font-family:Symbol;} ol 	{margin-bottom:0cm;} ul 	{margin-bottom:0cm;} --><br />
&#8211;&gt;<br />
<!--[if gte mso 10]><br />
<mce:style><!<br />
/* Style Definitions */<br />
table.MsoNormalTable<br />
{mso-style-name:"Table Normal";<br />
mso-tstyle-rowband-size:0;<br />
mso-tstyle-colband-size:0;<br />
mso-style-noshow:yes;<br />
mso-style-parent:"";<br />
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;<br />
mso-para-margin:0cm;<br />
mso-para-margin-bottom:.0001pt;<br />
mso-pagination:widow-orphan;<br />
font-size:10.0pt;<br />
font-family:"Times New Roman";<br />
mso-ansi-language:#0400;<br />
mso-fareast-language:#0400;<br />
mso-bidi-language:#0400;}<br />
table.MsoTableContemporary<br />
{mso-style-name:"Table Contemporary";<br />
mso-tstyle-rowband-size:1;<br />
mso-tstyle-colband-size:0;<br />
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;<br />
mso-border-insideh:2.25pt solid white;<br />
mso-border-insidev:2.25pt solid white;<br />
mso-para-margin:0cm;<br />
mso-para-margin-bottom:.0001pt;<br />
mso-pagination:widow-orphan;<br />
text-autospace:none;<br />
font-size:10.0pt;<br />
font-family:"Times New Roman";<br />
mso-ansi-language:#0400;<br />
mso-fareast-language:#0400;}<br />
table.MsoTableContemporaryFirstRow<br />
{mso-style-name:"Table Contemporary";<br />
mso-table-condition:first-row;<br />
mso-tstyle-shading:white;<br />
mso-tstyle-pattern:gray-20 black;<br />
mso-tstyle-diagonal-down:0cm none windowtext;<br />
mso-tstyle-diagonal-up:0cm none windowtext;<br />
font-family:"Times New Roman";<br />
mso-bidi-font-family:"Times New Roman";<br />
color:windowtext;<br />
mso-ansi-font-weight:bold;<br />
mso-bidi-font-weight:bold;}<br />
table.MsoTableContemporaryOddRow<br />
{mso-style-name:"Table Contemporary";<br />
mso-table-condition:odd-row;<br />
mso-tstyle-shading:white;<br />
mso-tstyle-pattern:gray-5 black;<br />
mso-tstyle-diagonal-down:0cm none windowtext;<br />
mso-tstyle-diagonal-up:0cm none windowtext;<br />
font-family:"Times New Roman";<br />
mso-bidi-font-family:"Times New Roman";<br />
color:windowtext;}<br />
table.MsoTableContemporaryEvenRow<br />
{mso-style-name:"Table Contemporary";<br />
mso-table-condition:even-row;<br />
mso-tstyle-shading:white;<br />
mso-tstyle-pattern:gray-20 black;<br />
mso-tstyle-diagonal-down:0cm none windowtext;<br />
mso-tstyle-diagonal-up:0cm none windowtext;<br />
font-family:"Times New Roman";<br />
mso-bidi-font-family:"Times New Roman";<br />
color:windowtext;}<br />
--><br />
<!--[endif]--></p>
<div class="Section1">
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal">FUNCTION</strong>: <strong style="mso-bidi-font-weight:normal">RetrieveBackAdjustedContract2</strong></p>
<p class="MsoNormal">
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal">PROPERTIES:</strong></p>
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal"> </strong></p>
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">IncludeSaturdays</strong></span>:“True” if Saturday data is desired.</p>
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal"> </strong></p>
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">IncludeHolidays</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>If NOT TRUE, than all data records reflect actual trading.<span style="mso-spacerun:yes"> </span>If TRUE, then weekdays on which there is no record are recorded with a day of week value of 8 and no price information.</p>
<p class="MsoNormal">
<p class="MsoNormal" style="tab-stops:120.75pt"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">OnHolidaysUsePreviousData</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>If<strong style="mso-bidi-font-weight: normal"> </strong>1, then the previous <span class="GramE">days</span> data is copied with the Date and <span class="SpellE">DayOfWeek</span> changed.</p>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal" style="tab-stops:120.75pt"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">OnHolidaysUseCloseOnly</strong></span><strong style="mso-bidi-font-weight:normal">:</strong> If 1, then the price values are set to the previous close and the volumes are set to zero.</p>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal" style="tab-stops:120.75pt"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">ShowDecimalPoint</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>controls whether prices are listed as integers or as strings representing the number (see 4.1.2.6 for details &#8211; <span class="SpellE">ConversionFactor</span>.)</p>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal" style="tab-stops:120.75pt"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">ConversionFactor</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>Most CSI data formats present price values as integers, according to the CSI format found in the &#8220;WSJ Price/CSI Price&#8221; column of the CSI Commodity Data Fact Sheet.<span style="mso-spacerun:yes"> </span>Please note the CSI price and the WSJ price, and when dealing with the CSI price values, consult the conversion factor column on the right hand side of each page. A conversion factor of -1, for example, reflects that the final digit is in eighths.<span style="mso-spacerun:yes"> </span>A CSI value of 3746 for wheat would be equivalent to 374 and 6/8, or 374-3/4..)</p>
<pre><span style="mso-bidi-font-size:12.0pt;font-family:Arial;mso-bidi-font-family:"> </span></pre>
<pre>CONVERSION FACTOR<span style="mso-tab-count:1">      </span><span style="mso-spacerun:yes">  </span>CONVERSION ACTION REQUIRED</pre>
<pre><span style="mso-tab-count:1">        </span>+6<span style="mso-tab-count:2">             </span>Move decimal point 6 places left</pre>
<pre><span style="mso-tab-count:1">        </span>+5<span style="mso-tab-count:2">             </span>Move decimal point 5 places left</pre>
<pre><span style="mso-tab-count:1">        </span>+4<span style="mso-tab-count:2">             </span>Move decimal point 4 places left</pre>
<pre><span style="mso-tab-count:1">        </span>+3<span style="mso-tab-count:2">             </span>Move decimal point 3 places left</pre>
<pre><span style="mso-tab-count:1">        </span>+2<span style="mso-tab-count:2">             </span>Move decimal point 2 places left</pre>
<pre><span style="mso-tab-count:1">        </span>+1<span style="mso-tab-count:2">             </span>Move decimal point 1 place left</pre>
<pre><span style="mso-tab-count:1">        </span> 0<span style="mso-tab-count:2">             </span>Leave number as it is</pre>
<pre><span style="mso-tab-count:1">        </span>-1<span style="mso-tab-count:2">             </span>Terminal digit is in eighths</pre>
<pre><span style="mso-tab-count:1">        </span>-2<span style="mso-tab-count:2">             </span>Terminal 2 digits are in 16ths</pre>
<pre><span style="mso-tab-count:1">        </span>-3<span style="mso-tab-count:2">             </span>Terminal 2 digits are in 32nds</pre>
<pre><span style="mso-tab-count:1">        </span>-4<span style="mso-tab-count:2">             </span>Terminal 2 digits are in 64ths</pre>
<pre><span style="mso-tab-count:1">        </span>-5<span style="mso-tab-count:2">             </span>Terminal 3 digits are in 128ths</pre>
<pre><span style="mso-tab-count:1">        </span>-6<span style="mso-tab-count:2">             </span>Terminal 3 digits are in 256ths</pre>
<pre><span style="mso-tab-count:1">        </span>-7<span style="mso-tab-count:2">             </span>Terminal 3 digits are in 32nds &amp; 1/2 32nds.</pre>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">DetrendMethod</strong></span><strong style="mso-bidi-font-weight:normal">:</strong> Indicates how and whether to <span class="SpellE">detrend</span> data being retrieved. <span class="SpellE">Detending</span>takes two prices, the first close (of the earliest date) in the series and a pivot price.<span style="mso-spacerun:yes"> </span>The pivot price may either be the close of the last day for the second-to-the-last contract or the close of the second-to-the-last day on file.<span style="mso-spacerun:yes"> </span>All days within the range have an amount added so that afterward the first close in the series matches the pivot price.<span style="mso-spacerun:yes"> </span>Here are the valid values.</p>
<div>
<table class="MsoNormalTable" style="border-collapse:collapse;border:none;mso-border-top-alt:solid black 1.5pt; mso-border-bottom-alt:solid black 1.5pt;mso-padding-alt:0cm 5.4pt 0cm 5.4pt" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes">
<td style="padding: 0cm 5.4pt; background: #666666 none repeat scroll 0% 0%; width: 164.3pt; border: 1.5pt medium medium solid none none black -moz-use-text-color -moz-use-text-color;" width="219" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><strong><span style="color:white">Name</span></strong></p>
</td>
<td style="padding: 0cm 5.4pt; background: #666666 none repeat scroll 0% 0%; width: 45.4pt; border: 1.5pt medium 1pt solid none black -moz-use-text-color;" width="61" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span style="color:white">Value</span></p>
</td>
</tr>
<tr style="mso-yfti-irow:1">
<td style="border: medium none; padding: 0cm 5.4pt; background: #cccccc none repeat scroll 0% 0%; width: 164.3pt;" width="219" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE"><strong>Detrend</strong></span><strong> By Second Contract</strong></p>
</td>
<td style="border: medium none; padding: 0cm 5.4pt; width: 45.4pt;" width="61" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">-1</p>
</td>
</tr>
<tr style="mso-yfti-irow:2">
<td style="border: 1pt solid silver; padding: 0cm 5.4pt; background: #cccccc none repeat scroll 0% 0%; width: 164.3pt;" width="219" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><strong>Not <span class="SpellE">Detrended</span></strong></p>
</td>
<td style="border: medium none; padding: 0cm 5.4pt; width: 45.4pt;" width="61" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">0</p>
</td>
</tr>
<tr style="mso-yfti-irow:3;mso-yfti-lastrow:yes">
<td style="padding: 0cm 5.4pt; background: #cccccc none repeat scroll 0% 0%; width: 164.3pt; border: medium medium 1pt none none solid -moz-use-text-color -moz-use-text-color windowtext;" width="219" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE"><strong>Detrend</strong></span><strong> by Second Day</strong></p>
</td>
<td style="padding: 0cm 5.4pt; width: 45.4pt; border: medium medium 1.5pt none none solid -moz-use-text-color -moz-use-text-color black;" width="61" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">+1</p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal" style="tab-stops:120.75pt"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">FillInCashPrices</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>Determines whether to retrieve Cash Prices.<strong style="mso-bidi-font-weight:normal"> </strong>The &#8220;cash&#8221; price may be an actual cash price, it may be lagged cash, which would only have been known the day after, or it may simply be the nearest future contract.</p>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal" style="tab-stops:120.75pt"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">ApplyCommodityAdjustments</strong></span><strong style="mso-bidi-font-weight:normal">:</strong> “True” to have adjustments made for unit of contract specification changes.</p>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">UseAlternateBackAdjuster</strong></span><strong style="mso-bidi-font-weight:normal">:</strong> If 1, then the Alternate Back Adjuster is used for all series, (default is the non-portfolio chart option value in UA). Notice that the standard back adjuster is fundamentally backward looking while the alternate back adjuster is fundamentally forward-looking which is why the Proportional accumulation is different.</p>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal" style="tab-stops:120.75pt"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">RaiseNegBackAdjustSeries</strong></span><strong style="mso-bidi-font-weight:normal">:</strong> controls whether UA automatically adds the smallest number of thousands of points to bring the back adjuster series into the non-negative domain</p>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal" style="tab-stops:120.75pt"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">NumDaysConfirmation</strong></span><strong style="mso-bidi-font-weight:normal">:</strong> selects how many consecutive volume and/or open interest roll <span class="GramE">signals<span style="mso-spacerun:yes"> </span>are</span> required before the algorithm rolls.<span style="mso-spacerun:yes"> </span>For the Standard Back Adjuster which views the market backward in time from the most recent to the most distant, this argument is ignored and has an effective value of 1.<span style="mso-spacerun:yes"> </span>For the Nth Nearest Future and the Alternate Back Adjuster, a value of at least 1 is required.</p>
<p class="MsoNormal" style="tab-stops:120.75pt">
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal">CloseOutOfRangeAdjustmentMethod: </strong>When a series settles outside of the daily range some software required the data to be “adjusted”.<span style="mso-spacerun:yes"> </span>The following are allowed:</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span><span class="SpellE"><span class="GramE">typedef</span></span> <span class="SpellE">enum</span><br />
{</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span><span class="SpellE">LeaveAlone_CloseOutOfRangeAdjustmentMethod</span>=0,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span><span class="SpellE">CompromiseHighLow_CloseOutOfRangeAdjustmentMethod</span>=1,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span><span class="SpellE">CompromiseClose_CloseOutOfRangeAdjustmentMethod</span>=2,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span>} <span class="SpellE">CloseOutOfRangeAdjustmentMethodType</span>;</p>
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal"> </strong></p>
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">RoundToTick</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>controls whether UA rounds values to the nearest tick</p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">UseTradeableTick</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>if <span class="SpellE">RoundToTick</span> is TRUE,<strong style="mso-bidi-font-weight:normal"> </strong>determines whether the settlement price should be rounded as per the exchange or the same way as the other prices.</p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">AggregateVolAs</strong></span><strong style="mso-bidi-font-weight:normal">, <span class="SpellE">AggregateOiAs</span>, and <span class="SpellE">AggregateCashAs</span>: </strong>When making weekly, monthly, quarterly, or annual Documents, how are these fields to be treated:</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span><span class="SpellE">AggregateAsLargest</span>,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span><span class="SpellE">AggregateAsSmallest</span>,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span><span class="SpellE">AggregateAsAverage</span>,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span><span class="SpellE">AggregateAsLast</span>,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"> </span><span class="SpellE">AggregateAsTotal</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">AggregateDateAsLastRecord</strong></span><strong style="mso-bidi-font-weight:normal">:</strong> TRUE if weekly, monthly, quarterly, and annual Documents should end on the date of the last data available.<span style="mso-spacerun:yes"> </span>For a weekly file generated after the close on Tuesday, the records would be Friday, Friday<span class="GramE">, …,</span> Friday, Tuesday.<span style="mso-spacerun:yes"> </span>If not TRUE, all records are on the same day of the week.</p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">AggregateDayOfWeekAs</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>If <span class="SpellE">AggregateDateAsLastRecord</span> is not TRUE, then what day of the week should the aggregate data <span class="GramE">be</span> assigned to:</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"><br />
</span>&#8220;Sunday&#8221;,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"><br />
</span>&#8220;Monday&#8221;,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"><br />
</span>&#8220;Tuesday&#8221;,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"><br />
</span>&#8220;Wednesday&#8221;,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"><br />
</span>&#8220;Thursday&#8221;,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"><br />
</span>&#8220;Friday&#8221;,</p>
<p class="MsoNormal"><span style="mso-spacerun:yes"><br />
</span>&#8220;Saturday&#8221;</p>
<p class="MsoNormal">
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal">PARAMETERS</strong></p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">MarketNumber</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>integer assigned by CSI to identify a contract underlying.</p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><span class="GramE"><strong style="mso-bidi-font-weight: normal">rollLogicType</strong></span></span><strong style="mso-bidi-font-weight:normal">: </strong>Identifies the logic to be used in deciding when to ignore a near contract:</p>
<p class="MsoNormal"><span style="mso-tab-count:1"> </span><span class="SpellE">RollOnOpenInterest</span> (-1)</p>
<p class="MsoNormal"><span style="mso-tab-count:1"> </span><span class="SpellE">RollOnVolume</span> (-2)</p>
<p class="MsoNormal"><span style="mso-tab-count:1"> </span><span class="SpellE">RollOnOpenInterestAndVolume</span> (-4)</p>
<p class="MsoNormal"><span style="mso-tab-count:1"> </span><span class="SpellE">RollOnOpenInterestOrVolume</span> (-3)</p>
<p class="MsoNormal"><span style="mso-tab-count:1"> </span><span class="SpellE">RollOnDayRelativeToStartOfMonth</span> (-5)</p>
<p class="MsoNormal"><span style="mso-tab-count:1"> </span><span class="SpellE">RollOnDayRelativeToEndOfMonth</span> (-6)</p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><span class="GramE"><strong style="mso-bidi-font-weight: normal">rollWhen</strong></span></span><strong style="mso-bidi-font-weight:normal">: </strong>time delay between when the day&#8217;s prices are published and when the day&#8217;s volume and open interest are published is handled.<span style="mso-spacerun:yes"> </span>(There is almost always a one-day delay.)<strong style="mso-bidi-font-weight: normal"></strong></p>
<table class="MsoNormalTable" style="border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;  mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-border-insideh:.5pt solid windowtext;  mso-border-insidev:.5pt solid windowtext" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes">
<td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 131.4pt;" width="175" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Name</p>
</td>
<td style="padding: 0cm 5.4pt; width: 40.5pt; border: 1pt 1pt 1pt medium solid solid solid none windowtext windowtext windowtext -moz-use-text-color;" width="54" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Value</p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: 1pt 1pt 1pt medium solid solid solid none windowtext windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Nth Nearest Rolls</p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: 1pt 1pt 1pt medium solid solid solid none windowtext windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Alt Back Adjust</p>
</td>
<td style="padding: 0cm 5.4pt; width: 84.5pt; border: 1pt 1pt 1pt medium solid solid solid none windowtext windowtext windowtext -moz-use-text-color;" width="113" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Std Back Adjust</p>
</td>
</tr>
<tr style="mso-yfti-irow:1">
<td style="padding: 0cm 5.4pt; width: 131.4pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="175" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE">RollWhen_Anticipated</span></p>
</td>
<td style="padding: 0cm 5.4pt; width: 40.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="54" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">2</p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Invalid</p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Invalid</p>
</td>
<td style="padding: 0cm 5.4pt; width: 84.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="113" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">28<sup>th</sup></p>
</td>
</tr>
<tr style="mso-yfti-irow:2">
<td style="padding: 0cm 5.4pt; width: 131.4pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="175" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE">RollWhen_Reported</span></p>
</td>
<td style="padding: 0cm 5.4pt; width: 40.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="54" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">0</p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">28<sup>th</sup></p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">28<sup>th</sup></p>
</td>
<td style="padding: 0cm 5.4pt; width: 84.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="113" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">29<sup>th</sup></p>
</td>
</tr>
<tr style="mso-yfti-irow:3">
<td style="padding: 0cm 5.4pt; width: 131.4pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="175" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE">RollWhen_Known</span></p>
</td>
<td style="padding: 0cm 5.4pt; width: 40.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="54" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">1</p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">29<sup>th</sup></p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">29<sup>th</sup></p>
</td>
<td style="padding: 0cm 5.4pt; width: 84.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="113" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">30<sup>th</sup></p>
</td>
</tr>
<tr style="mso-yfti-irow:4;mso-yfti-lastrow:yes">
<td style="padding: 0cm 5.4pt; width: 131.4pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="175" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">RollWhen_Lagged2</p>
</td>
<td style="padding: 0cm 5.4pt; width: 40.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="54" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">3</p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">30<sup>th</sup></p>
</td>
<td style="padding: 0cm 5.4pt; width: 76.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="102" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">30<sup>th</sup></p>
</td>
<td style="padding: 0cm 5.4pt; width: 84.5pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="113" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3;tab-stops: 66.75pt">Invalid</p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal"> </strong></p>
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">DayOfMonthToRoll</strong></span><strong style="mso-bidi-font-weight:normal"> </strong><strong style="mso-bidi-font-weight:normal"><span style="mso-bidi-font-size:10.0pt">and <span class="SpellE">MonthsPriorToRoll</span></span>: </strong>used when the <span class="SpellE">rollLogicType</span> is a date roll to determine when the roll takes place.</p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><span class="GramE"><strong style="mso-bidi-font-weight: normal">accumulationMethod</strong></span></span><strong style="mso-bidi-font-weight: normal">: </strong>Determines whether to adjust backward or forward.</p>
<table class="MsoNormalTable" style="border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt; mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-border-insideh:.5pt solid windowtext; mso-border-insidev:.5pt solid windowtext" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes">
<td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 159.6pt;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Name</p>
</td>
<td style="padding: 0cm 5.4pt; width: 48.3pt; border: 1pt 1pt 1pt medium solid solid solid none windowtext windowtext windowtext -moz-use-text-color;" width="64" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Valid</p>
</td>
<td style="padding: 0cm 5.4pt; width: 270.9pt; border: 1pt 1pt 1pt medium solid solid solid none windowtext windowtext windowtext -moz-use-text-color;" width="361" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Meaning</p>
</td>
</tr>
<tr style="mso-yfti-irow:1">
<td style="padding: 0cm 5.4pt; width: 159.6pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Proportional</p>
</td>
<td style="padding: 0cm 5.4pt; width: 48.3pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="64" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span style="mso-spacerun:yes"> </span>-1</p>
</td>
<td style="padding: 0cm 5.4pt; width: 270.9pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="361" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">(Deprecated)A multiplicative ratio factor is applied rather than an additive factor.<span style="mso-spacerun:yes"> </span>Because of the backward viewing perspective, the standard back adjuster brings the data to the current day contract level whereas because of the forward viewing perspective, the alternate back adjuster brings the data to the earliest contract level.<span style="mso-spacerun:yes"> </span>Prices cannot fall into negative territory in the past with this option.</p>
</td>
</tr>
<tr style="mso-yfti-irow:2">
<td style="padding: 0cm 5.4pt; width: 159.6pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Back</p>
</td>
<td style="padding: 0cm 5.4pt; width: 48.3pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="64" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span style="mso-spacerun:yes"> </span>0</p>
</td>
<td style="padding: 0cm 5.4pt; width: 270.9pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="361" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Adds adjustments to bring historical data to the current day contract level. This option can result in negative price readings into the past.</p>
</td>
</tr>
<tr style="mso-yfti-irow:3;mso-yfti-lastrow:yes">
<td style="padding: 0cm 5.4pt; width: 159.6pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Forward</p>
</td>
<td style="padding: 0cm 5.4pt; width: 48.3pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="64" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span style="mso-spacerun:yes"> </span>+1</p>
</td>
<td style="padding: 0cm 5.4pt; width: 270.9pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="361" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Subtracts adjustments to bring historical data to the earliest contract level.<span style="mso-spacerun:yes"> </span>Because of the effects of inflation, by using this option, prices are less likely to move negative into the future.</p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt; margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE"><span class="GramE"><strong style="mso-bidi-font-weight:normal">rollDeltaType</strong></span></span><strong style="mso-bidi-font-weight:normal">: </strong>identifies which contract values are used to measure the carrying charges for which the data is being adjusted.</p>
<table class="MsoNormalTable" style="border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt; mso-padding-alt:0cm 5.4pt 0cm 5.4pt;mso-border-insideh:.5pt solid windowtext; mso-border-insidev:.5pt solid windowtext" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes">
<td style="border: 1pt solid windowtext; padding: 0cm 5.4pt; width: 159.6pt;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Name</p>
</td>
<td style="padding: 0cm 5.4pt; width: 52.8pt; border: 1pt 1pt 1pt medium solid solid solid none windowtext windowtext windowtext -moz-use-text-color;" width="70" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Value</p>
</td>
<td style="padding: 0cm 5.4pt; width: 266.4pt; border: 1pt 1pt 1pt medium solid solid solid none windowtext windowtext windowtext -moz-use-text-color;" width="355" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Effect</p>
</td>
</tr>
<tr style="mso-yfti-irow:1">
<td style="padding: 0cm 5.4pt; width: 159.6pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE">OpenToOpen</span></p>
</td>
<td style="padding: 0cm 5.4pt; width: 52.8pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="70" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span style="mso-spacerun:yes"> </span>-1</p>
</td>
<td style="padding: 0cm 5.4pt; width: 266.4pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="355" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Simulates rolling by an on-the-open spread order.</p>
</td>
</tr>
<tr style="mso-yfti-irow:2">
<td style="padding: 0cm 5.4pt; width: 159.6pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE">CloseToClose</span></p>
</td>
<td style="padding: 0cm 5.4pt; width: 52.8pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="70" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span style="mso-spacerun:yes"> </span>0</p>
</td>
<td style="padding: 0cm 5.4pt; width: 266.4pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="355" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Simulates rolling by an on-the-close spread order.</p>
</td>
</tr>
<tr style="mso-yfti-irow:3">
<td style="padding: 0cm 5.4pt; width: 159.6pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE">CloseToOpen</span></p>
</td>
<td style="padding: 0cm 5.4pt; width: 52.8pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="70" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span style="mso-spacerun:yes"> </span>+1</p>
</td>
<td style="padding: 0cm 5.4pt; width: 266.4pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="355" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Simulates an exit order on the close and an enter order on the next open.</p>
</td>
</tr>
<tr style="mso-yfti-irow:4">
<td style="padding: 0cm 5.4pt; width: 159.6pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE">CloseToOpenOldGap</span></p>
</td>
<td style="padding: 0cm 5.4pt; width: 52.8pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="70" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span style="mso-spacerun:yes"> </span>+2</p>
</td>
<td style="padding: 0cm 5.4pt; width: 266.4pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="355" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Mathematically equivalent to <span class="SpellE">OpenToOpen</span>.</p>
</td>
</tr>
<tr style="mso-yfti-irow:5;mso-yfti-lastrow:yes">
<td style="padding: 0cm 5.4pt; width: 159.6pt; border: medium 1pt 1pt none solid solid -moz-use-text-color windowtext windowtext;" width="213" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span class="SpellE">CloseToOpenNewGap</span></p>
</td>
<td style="padding: 0cm 5.4pt; width: 52.8pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="70" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom: 6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3"><span style="mso-spacerun:yes"> </span>+3</p>
</td>
<td style="padding: 0cm 5.4pt; width: 266.4pt; border: medium 1pt 1pt medium none solid solid none -moz-use-text-color windowtext windowtext -moz-use-text-color;" width="355" valign="top">
<p class="MsoNormal" style="margin-top:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm;page-break-after:avoid;mso-outline-level:3">Mathematically equivalent to <span class="SpellE">CloseToClose</span>, except that the Alternate back adjuster requires one fewer days of existence for an explicit <span class="SpellE">CloseToClose</span>.</p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal"> </strong></p>
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">ValidMonths</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>Selects which delivery months to consider. The <span class="SpellE">ValidMonths</span> argument must be a string of 12 characters, one character for each month.<span style="mso-spacerun:yes"> </span>Each character determines whether contracts deliverable in that month <span class="GramE">are</span> included.<span style="mso-spacerun:yes"> </span>A contract is included if there is a &#8216;V&#8217; (for valid) in that position.<span style="mso-spacerun:yes"> </span>A value of &#8216;I&#8217; for invalid causes exclusion.</p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">GenerateForward</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>If the <span style="mso-no-proof: yes">UseAlternateBackAdjuster is zero</span> then <span class="SpellE">GenerateFoward</span> will have no effect. <span class="GramE">TRUE or 1 to begin with the earliest data and step day-by-day to the current day.</span> <span class="GramE">FLASE or 0 to begin with the current contract and <span class="SpellE">prepend</span> earlier data.</span></p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">RollAtLeastNDaysBeforeExpiration</strong></span><strong style="mso-bidi-font-weight:normal">: </strong>definition a bit shaky…<strong style="mso-bidi-font-weight:normal"> </strong></p>
<p class="MsoNormal"><span class="GramE">causes</span> a roll to happen if necessary to avoid getting too close to expiration.</p>
<p class="MsoNormal">If you are not generating forward (zero), then the standard back adjuster is applied.<span style="mso-spacerun:yes"> </span>If the <span class="SpellE">RollAtLeastNDaysBeforeExpiration</span> is greater than zero, then the <span class="SpellE">rollLogicType</span> is overridden so that rolls happen based only on expiration.<span style="mso-spacerun:yes"> </span>(Like a roll relative to month end.).</p>
<p class="MsoNormal">
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">StartDate</strong></span><strong style="mso-bidi-font-weight:normal"> and <span class="SpellE">EndDate</span>: </strong>These two long integers allow the user to limit the retrieval to a date range.<span style="mso-spacerun:yes"> </span>Use the values -1, -1 or <span class="GramE">0 ,0</span> if you want the full history available.<span style="mso-spacerun:yes"> </span>Can significantly improve performance, but for forward generated Nth Nearest Future and Back-Adjusted contracts can result in different contract choices.</p>
<p class="MsoNormal"><strong style="mso-bidi-font-weight:normal"> </strong></p>
<p class="MsoNormal"><span class="SpellE"><strong style="mso-bidi-font-weight:normal">ProportionalAdjustment</strong></span><strong style="mso-bidi-font-weight:normal">:</strong> If the <span class="SpellE">ProportionalAdjustment</span> parameter is non-zero, then the Backward or Forward adjustments are applied by a multiplicative ratio factor rather than an additive factor. When the standard back adjuster is applied, only <span class="GramE">Backward</span> adjustments can be applied proportionally.<strong style="mso-bidi-font-weight:normal"></strong></p>
</div>
<img src="http://www.automated-trading-system.com/?ak_action=api_record_view&id=202&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.automated-trading-system.com/unfair-advantage-api-code-c-extract-futures-continuous-data/' rel='bookmark' title='Permanent Link: Unfair Advantage API Code (C#): Extract Futures Continuous data'>Unfair Advantage API Code (C#): Extract Futures Continuous data</a></li>
<li><a href='http://www.automated-trading-system.com/continuous-contract-options/' rel='bookmark' title='Permanent Link: Continuous Contract options'>Continuous Contract options</a></li>
<li><a href='http://www.automated-trading-system.com/unfair-advantage-csi/' rel='bookmark' title='Permanent Link: I just got myself an Unfair Advantage&#8230;'>I just got myself an Unfair Advantage&#8230;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/unfair-advantage-api-retrieve-back-adjusted-contracts-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
