<?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; Futures</title>
	<atom:link href="http://www.automated-trading-system.com/tag/futures/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>Tue, 07 Feb 2012 09:58:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Trend Following returns breakdown</title>
		<link>http://www.automated-trading-system.com/trend-following-returns-breakdown/</link>
		<comments>http://www.automated-trading-system.com/trend-following-returns-breakdown/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 11:16:38 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Strategies]]></category>
		<category><![CDATA[Trend Following]]></category>
		<category><![CDATA[backwardation]]></category>
		<category><![CDATA[contango]]></category>
		<category><![CDATA[Futures]]></category>
		<category><![CDATA[research paper]]></category>
		<category><![CDATA[rollover]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=2433</guid>
		<description><![CDATA[Following the previous post on backwardation, contango and crude oil, let&#8217;s look at how several factors can play a part in the overall trend following trading system performance. I have previously referenced the study by EDHEC Risk, which shows the different sources of return of a Trend Following strategy. The authors build the Mt. Lucas [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/07/TFReturns.png" alt="TFReturns" title="TFReturns" width="450" height="271" class="aligncenter size-full wp-image-2434" /></p>
<p>Following the previous post on <a href="http://www.automated-trading-system.com/crude-oil-contango-and-roll-yield-for-commodity-trading/">backwardation, contango and crude oil</a>, let&#8217;s look at how <strong>several factors</strong> can play a part in the <strong>overall trend following trading system performance</strong>.</p>
<p>I have previously referenced the <a href="http://docs.edhec-risk.com/EID-2008-Doc/documents/Evaluating_Trend-Following_Commodity_Index.pdf" target="_blank" rel="nofollow">study by EDHEC Risk</a>, which shows the different sources of return of a Trend Following strategy.</p>
<p>The authors build the <strong>Mt. Lucas Management (MLM) index</strong>, which applies a 200-day moving average Trend Following strategy to a diversified range of 25 futures markets, rebalanced monthly. The performance of the index is separated in three periods and further broken down by the three individual sources of return identified by the authors:<span id="more-2433"></span></p>
<ol>
<li>T-Bill returns on marginable assets</li>
<li>Static returns from trend-following futures markets</li>
<li>Rebalancing gains</li>
</ol>
<p>The chart below shows the representation of each component&#8217;s participation to the overall return:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/07/EDHEC-TF-breakdown.png" alt="EDHEC-TF-breakdown" title="EDHEC-TF-breakdown" width="500" height="295" class="alignnone size-full wp-image-2435" /></p>
<p>You might find it surprising how relatively small the impact of the actual Trend Following strategy return is (<em>I know I did&#8230;</em>)</p>
<h3>Further breakdown</h3>
<p>The previous post highlighted that the performance of any Crude Oil futures contract was <strong>unable to match</strong> the performance of the spot price (despite a fairly high beta of 0.83). This is mostly because holding commodities via futures contracts expose you to the spot price beta move (as mostly anticipated) <em>but also</em> to the yield curve of that futures contract.</p>
<p>Over time, the impact of the backwardation or contango in the yield curve (roll yield) can create a <strong>large drift</strong> between the actual spot price performance and the equivalent futures contract.</p>
<p>This is very apparent in a simple &#8220;buy-and-hold&#8221; example (as in the Crude Oil case) but the same would apply to <strong>any trading strategy using futures instruments</strong>. Any futures trade could be broken down into two &#8220;components&#8221;:</p>
<ul>
<li>spot price beta move</li>
<li>roll yield</li>
</ul>
<p>And therefore the sum of all the trades resulting from a trading strategy (such as Trend Following) could fall into these two same categories, giving us now four overall components.</p>
<ol>
<li>T-Bill returns on marginable assets</li>
<li>Returns from trend-following spot price beta moves</li>
<li>Roll yield</li>
<li>Rebalancing gains</li>
</ol>
<h3>Roll Yield: a misnomer?</h3>
<p>Note that <strong>Roll yield</strong> is not aptly named; it implies that the act of rolling contracts yield a specific return. However, the return resulting from contango or backwardation is merely &#8220;crystallized&#8221; at the time of rolling contracts: the contango premium (backwardation discount) actually deflates over time gradually.</p>
<p>For example, think of buying a Crude Oil contract at the beginning of the month with a premium over spot of $1 per barrel (at $76). If the spot price does not change during the whole month, the price of the future contract simply converges to the spot price ($75) &#8211; the premium simply deflates. When selling the contract at the end of the month, you will have lost $1 without doing a contract roll and with the price having stayed stable.<br />
&nbsp;<br />
&nbsp;<br />
Breaking down the actual components of a global strategy might be helpful in order to understanding the sources of returns and focus on a specific one to possibly improve it and enhance the overall system. For example, a more sophisticated approach to rolling contracts might enhance the overall roll yield produced by the trading strategy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/trend-following-returns-breakdown/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to decide on a Backtesting and Trading Platform</title>
		<link>http://www.automated-trading-system.com/backtesting-trading-platform/</link>
		<comments>http://www.automated-trading-system.com/backtesting-trading-platform/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 11:31:55 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[amibroker]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[CSI]]></category>
		<category><![CDATA[eSignal]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[Futures]]></category>
		<category><![CDATA[introducing broker]]></category>
		<category><![CDATA[NinjaTrader]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[tradersstudio]]></category>
		<category><![CDATA[tradestation]]></category>
		<category><![CDATA[Zen Fire]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=760</guid>
		<description><![CDATA[As an automated trader you probably need the following components: Broker Account &#8211; The starting point to trade in the markets Live Market Data &#8211; To feed to your trading robot so that it can generate trading signals. Most brokers provide market data with proprietary or third-party technology- although market data can also be obtained [...]]]></description>
			<content:encoded><![CDATA[<p>As an automated trader you probably need the following components:</p>
<ul>
<li><strong>Broker Account</strong> &#8211; The starting point to trade in the markets</li>
<li><strong>Live Market Data</strong> &#8211; To feed to your trading robot so that it can generate trading signals. Most brokers provide market data with proprietary or third-party technology- although market data can also be obtained from an independent vendor (e.g. eSignal).</li>
<li><strong>Order Routing</strong> &#8211; To transmit your orders to the exchange. These can be proprietary to the executing broker or third-party based (e.g. Zen Fire).</li>
<li><strong>Broker Trading Platform</strong> &#8211; To access your account information, place orders, etc.</li>
<li><strong>Charting Platform</strong> &#8211; Sometimes the broker platform charting capabilities are mediocre and an independent charting platform is required (e.g. eSignal)</li>
<li><strong>Signal Generation Platform</strong> &#8211; The actual trading robot: it analyses market data, account and positions information and implements the automated trading strategies to generate trade management signals (i.e. Buy / Sell / Exit, etc.).</li>
<li><strong>Excecution Platform</strong> &#8211; Receives trade signals and forwards them to the order routing.</li>
<li><strong>Platform Hosting</strong> &#8211; You can host the trading robot on your local machine, host it in a dedicated rented server or entrust a specialised broker to host and run your trading robot.</li>
<li><strong>Historical Market Data</strong> &#8211; Used as source for back-testing trading strategies</li>
<li><strong>Strategy Development Application</strong> &#8211; Allows for coding, optimisation, back-test and result analysis of trading strategies.</li>
<li><strong>Statistical Analysis package</strong> &#8211; for in-depth statistical analysis of back-testing results.</li>
</ul>
<p>Some of these distinctions are physical, some are logical. For example, TradeStation packs many of the points above into one system: a broker account and a trading platform that allows you to:<span id="more-760"></span><br />
Access live market data + Visualise price charts + Automate trading strategies that generate signals + Route the trading signals as orders on the exchange + Access account information + Store historical data + Back-test strategies</p>
<p>Sounds like it fits the bill perfectly, doesn&#8217;t it?<br />
Well let&#8217;s look at the areas you need to consider when deciding on your automated platform.</p>
<h3>Type of broker</h3>
<p>Different issues to consider: is the broker a clearing broker, a non-clearing FCM or an introducing broker? If the latter is it an independent introducing broker or a guaranteed introducing broker (backed by a clearer)? It would seem that the closer to the exchange  you broker is (in terms of relationship), the better/safer it is. See <a href="http://www.automated-trading-system.com/anatomy-futures-transaction/">Anatomy of a Futures transaction</a> for more detail on the different types of brokers.</p>
<h3>Markets supported</h3>
<p>Every broker offers access to different products and different markets. For example Interactive Brokers offers one of most complete coverage (worldwide Futures, Options, Equites and Forex) all &#8220;housed&#8221; under the same Universal Account. Other brokers only offer access to specific products/markets.</p>
<h3>Latency/Speed</h3>
<p>For some type of trading strategy, this can have a large impact and various platforms/feeds offer different levels of performance. This has led to specialist companies such as Zen Fire or Trading Technologies &#8211; which locate their servers very close to the exchange &#8211; achieving speed and reliability for data feed and order routing. They offer their services to brokers who can in turn offer it to their clients.</p>
<h3>Development Language</h3>
<p>This is mostly a matter of personal preference, experience and expertise. TradeStation has been around for longer and a big collection of Easy Language scripts are available for re-use while NinjaTrader, for example, uses C# and CQG Trader their own language.</p>
<h3>Strategy Complexity vs. Platform Functionality</h3>
<p>Most of the automated trading platforms that offer back-testing functionality lack sophistication of dedicated applications such as Mechanica, TraderStudio or Trading Blox. For example portfolio testing is usually not available in the live trading platforms. This might work for some simple strategies but not for more complex Money Management ones.</p>
<h3>Hosting</h3>
<p>You can run the trading robot on your machine, which makes you subject to power and connection failures or you can choose to rent a server to host your robot. Some brokers also offer trading strategy hosting and execution on their own servers.</p>
<h3>Charting</h3>
<p>Some specialised platforms offer better charting capabilities than the standard trading platforms and can be used as a standalone charting application. Some, such as eSignal, also offer a data feed.</p>
<h3>Costs</h3>
<p>An obvious one but between platform costs, execution costs, hardware, etc. there exists a wide range between bottom-end and top-end offerings.</p>
<h3>What/how to choose?</h3>
<p>While researching for this article I have come across <em>many</em> different packages offering different solutions. One of the best ways to help you decide on a solution that makes sense to <em>you</em> is to list <em>your goals</em> and cross-check each platform against them <a href="http://home.comcast.net/~countertrender/AI_for_the_Individual_Trader.pdf" target="_blank" rel="nofollow">in this fashion (PDF doc)</a>.</p>
<p>There are endless possibilities for combining all the differenty packages. Just for fun I tried to &#8220;virtually build&#8221; the opposite of an all-in-one package such as TradeStation (which will probably not address most automated trader goals) &#8211; here is one &#8220;wacky&#8221; implementation.<br />
<div id="attachment_762" class="wp-caption aligncenter" style="width: 460px"><img src="http://www.automated-trading-system.com/wp-content/uploads/2009/10/wacky-architecture.png" alt="wacky ATS architecture" title="wacky-architecture" width="450" height="450" class="size-full wp-image-762" /><p class="wp-caption-text">A trader decides to use TradeStation as a signal generating platform. However she does not want to use TradeStation data feed and instead decides to go for the eSignal package integrating the broker Dorman Trading and the Zen-Fire connection for market data and a charting platform. In order to route the market data to TradeStation, she needs a bridge application - OwnData from TS Support for example. The backup feed solution would be TradeStation data feed. For the execution side of things, our trader decides to send the trading signals generated by TradeStation to NinjaTrader, which can route the orders to the exchange through a broker. The primary route is through Velocity Futures broker using Trading Technologies order routing, while the secondary route is through Interactive Brokers via their TWS trading platform and API! Additionally, the strategy research and testing is performed with Mechanica using CQG tick data while the results are analysed using R.</p></div></p>
<h3>Conclusion</h3>
<p>Sorry to end up on a cliche but there are no silver bullet to making the choice. If you take away one point is that you need to list your own requirements clearly and make the choice for yourself based on them.</p>
<p>Check that <a href="http://www.elitetrader.com/vb/showthread.php?threadid=108534<br />
" target="_blank" rel="nofollow">60-page thread at EliteTrader</a> if you want an endless discussion as to which is the best platform/architecture&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/backtesting-trading-platform/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Anatomy of a Futures transaction</title>
		<link>http://www.automated-trading-system.com/anatomy-futures-transaction/</link>
		<comments>http://www.automated-trading-system.com/anatomy-futures-transaction/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 13:12:27 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Futures]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[broker]]></category>
		<category><![CDATA[ccp]]></category>
		<category><![CDATA[clearing]]></category>
		<category><![CDATA[counterparty]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[FCM]]></category>
		<category><![CDATA[introducing broker]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=735</guid>
		<description><![CDATA[When looking around for automated trading platforms, you soon realise that the offerings are numerous and all seem to take a different form or approach (i.e. TradeStation vs. Interactive Brokers vs. NinjaTrader vs. Zen-Fire vs. eSignal vs. TradersStudio, etc. &#8211; the list is very long!). To understand what they all offer, it is important to [...]]]></description>
			<content:encoded><![CDATA[<p>When looking around for automated trading platforms, you soon realise that the offerings are numerous and all seem to take a different form or approach (i.e. <em>TradeStation vs. Interactive Brokers vs. NinjaTrader vs. Zen-Fire vs. eSignal vs. TradersStudio</em>, etc. &#8211; the list is very long!).<br />
To understand what they all offer, it is important to first situate <strong>all the actors on the chain of transactions</strong> that a trade generates.</p>
<p>Here is a &#8220;gradual&#8221; description of how a Futures trade takes place with all intermediaries involved:</p>
<h3>A BUYER AND A SELLER</h3>
<p>In its most basic form a transaction involves 2 parties: <strong>a buyer and a seller</strong>.<br />
<div id="attachment_740" class="wp-caption aligncenter" style="width: 349px"><img src="http://www.automated-trading-system.com/wp-content/uploads/2009/10/anatomy5.png" alt="A buyer transacts directly with a seller" title="anatomy5" width="339" height="193" class="size-full wp-image-740" /><p class="wp-caption-text">A buyer transacts directly with a seller</p></div></p>
<h3>THE EXCHANGE: A CENTRAL &#8220;MEETING&#8221; PLACE</h3>
<p><span id="more-735"></span><br />
However buyers need to find sellers and vice-versa. This is where <strong>exchanges</strong> come into play. They are a central place where trading takes place.</p>
<p>For example, the <em>Chicago Board of Trade</em> (CBOT) is the central place where wheat trading takes place. All sellers and buyers meet and agree on transaction prices there. Exchanges also enforce rules such as <strong>standardised terms</strong> (e.g. wheat futures contract provides for delivery of 5,000 bushels of any of several varieties of wheat during March, May, July, September, or December).<br />
<div id="attachment_741" class="wp-caption aligncenter" style="width: 510px"><img src="http://www.automated-trading-system.com/wp-content/uploads/2009/10/anatomy4.png" alt="All buyers and sellers come to the exchange to transact" title="anatomy4" width="500" height="236" class="size-full wp-image-741" /><p class="wp-caption-text">All buyers and sellers come to the exchange to transact</p></div></p>
<h3>COUNTERPARTY RISK</h3>
<p>Futures contracts are an agreement between two parties for future delivery of an underlying (e.g. wheat) in exchange for a Cash amount (settlement) dictated by the agreed price. Up until settlement, there is risk that one of the parties will not be able to fulfil its obligation and result in a financial loss to the other party. This is called <em>Counterparty Risk</em>.</p>
<p>To avoid this situation, an intermediary, part of the exchange, will <strong>guarantee the trade</strong>. This is the <strong>Central CounterParty</strong>. All trades are actually given up to the Central CounterParty &#8211; which means that technically you buy from the CCP and your counterparty (the other side of the trade) sells to the CCP.</p>
<p>The CCP enforces each party to maintain adequate levels of <strong>initial and variation margin</strong> to cover any potential losses. All of the CCP trades are cleared through its <strong>clearing house</strong>.<br />
<div id="attachment_744" class="wp-caption aligncenter" style="width: 510px"><img src="http://www.automated-trading-system.com/wp-content/uploads/2009/10/anatomy3.png" alt="The exchange provides a Central CounterParty and Clearing House to act as a guarantee between buyer and seller." title="anatomy3" width="500" height="234" class="size-full wp-image-744" /><p class="wp-caption-text">The exchange provides a Central CounterParty and Clearing House to act as a guarantee between buyer and seller.</p></div></p>
<h3>BROKER INTERMEDIATION</h3>
<p>Now, there are millions of buyers and sellers that want to trade on the exchange. The exchange is not going to deal with all buyers and sellers. Instead, an exchange is a B2B-only platform where <strong>broker-dealer</strong> firms place their trades between each other.</p>
<p>For a buyer to trade, she needs to go through a broker to place her order/trade on the exchange. However broker-dealers (also called <em>Futures Commission Merchant</em> &#8211; FCM) are large independent firms, or part of large investment/commercial banks. As such they will not deal with most clients (retail and small institutional). Those clients would go through <strong>Introducing Brokers</strong> (IB), which will act as an extra intermediary between the client (you) and the exchange in a B2C fashion &#8211; delegating the trade execution, back-office operations, etc. to the FCM.</p>
<p>There is a further distinction between FCM:</p>
<ul>
<li><strong>Clearing FCM</strong>, which is a clearing member of an exchange</li>
<li><strong>Non-clearing FCM</strong>, which must clear its trade through a clearing FCM</li>
</ul>
<div id="attachment_745" class="wp-caption aligncenter" style="width: 510px"><img src="http://www.automated-trading-system.com/wp-content/uploads/2009/10/anatomy2.png" alt="The picture gets fuller with broker intermediaries: Introducing Brokers, clearing and non-clearing FCM." title="anatomy2" width="500" height="228" class="size-full wp-image-745" /><p class="wp-caption-text">The picture gets fuller with broker intermediaries: Introducing Brokers, clearing and non-clearing FCM.</p></div>
<h3>HOW TRADING TAKES PLACE AT THE EXCHANGE</h3>
<p>In the old days, most trading took place in <strong>open outcry</strong>, on the trading floor of the exchange, between the local representatives of the broker-dealer firms (traders, brokers, market-makers/specialists). Floor traders stand in a trading pit to call out orders, prices, and quantities of a particular commodity by making &#8220;crazy hand gestures&#8221; (think of the last scene of <a href="http://www.amazon.com/exec/obidos/ASIN/B000O59A16/autotradblog-20" target="_blank" rel="nofollow">Trading Places</a>). Note that open outcry is pre-dated by <strong>blackboard trading</strong>.</p>
<p><strong>Electronic trading</strong> has emerged in the last decades and gradually replaced open outcry. The electronic platform of an exchange (e.g. <em>e-cbot</em> for CBOT) is essentially a matching engine which all broker-dealers connect to and submit their orders.<br />
<div id="attachment_746" class="wp-caption aligncenter" style="width: 510px"><img src="http://www.automated-trading-system.com/wp-content/uploads/2009/10/anatomy1.png" alt="The full picture." title="anatomy1" width="500" height="235" class="size-full wp-image-746" /><p class="wp-caption-text">The full picture.</p></div></p>
<p>With the advent of electronic trading a new class of brokers has appeared: <strong>Direct Access Trading</strong> (DAT) brokers. They offer their clients (including retail) an electronic platform that allows for a direct access to the exchange (as opposed to more traditional online retail brokers, which are just an electronic IB). DAT brokers usually offer to retail investors low transaction costs and high execution speed.</p>
<p>I hope I have not forgotten anything. If so, please let me know in the comments. In a next post I will investigate how the various automated trading platforms fit into that model.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/anatomy-futures-transaction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unfair Advantage API Code (C#): Extract Futures Continuous data</title>
		<link>http://www.automated-trading-system.com/unfair-advantage-api-code-c-extract-futures-continuous-data/</link>
		<comments>http://www.automated-trading-system.com/unfair-advantage-api-code-c-extract-futures-continuous-data/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 15:37:09 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Futures]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CSI]]></category>
		<category><![CDATA[rollover]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[Unfair Advantage]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=279</guid>
		<description><![CDATA[As mentioned in the previous post on retrieving Back-Adjusted Contracts using the RetrieveBackAdjustedContract2 function of the Unfair Advantage API, I have coded up this very simple project to read a list of Futures underlying instruments, retrieve a proportionally back-adjusted contract for each of the instruments and oputput it to a file. Getting started with the [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned in the previous post on <a href="http://www.automated-trading-system.com/unfair-advantage-api-retrieve-back-adjusted-contracts-function/" target="_blank">retrieving Back-Adjusted Contracts using the RetrieveBackAdjustedContract2 function of the Unfair Advantage API</a>, I have coded up this very simple project to read a list of Futures underlying instruments, retrieve a proportionally back-adjusted contract for each of the instruments and oputput it to a file.</p>
<h3>Getting started with the API</h3>
<p>Fire up your favourite IDE/language that supports COM Interoperability (I am using Visual C# 2008 Express Edition), start Console Application project and add a reference to the Unfair Advantage API. For this you just need to &#8220;Add reference&#8221; and browse to the Unfair Advantage installation folder and select the main EXE (uad.exe). This gives access to the CSI UA API.</p>
<div id="attachment_288" class="wp-caption aligncenter" style="width: 606px"><img src="http://www.automated-trading-system.com/wp-content/uploads/2009/09/UA-C-reference1.jpg" alt="Add UA into your project and &quot;Bob&#039;s your Uncle!&quot;" title="UA-C#-reference" width="500" height="457" class="size-full wp-image-288" /><p class="wp-caption-text">Add UA into your project and &quot;Bob's your Uncle!&quot;</p></div>
<h3>Simple extraction code</h3>
<p>The rest is fairly simple as long as you<span id="more-279"></span> <a href="http://www.automated-trading-system.com/unfair-advantage-api-retrieve-back-adjusted-contracts-function/" target="_blank">understand the RetrieveBackAdjustedContract2 parameters</a>.<br />
The code below takes 2 parameters: an input file name containing the list of markets to extract and a folder name to extract each continuous contract to. It sets specific UA session parameters and calls the RetrieveBackAdjustedContract2 with specific variables to obtain the concatenation desired. Each continuous contract is output to a folder in a .txt file.<br />
The file containing the list of markets is of the following format (CSI number, Symbol, Market name):<br />
&#8230;<br />
8,CT,Cotton<br />
&#8230;</p>
<h3>The code</h3>
<p>Please find the code <a href="http://www.automated-trading-system.com/pages/csharp-uaapi-continuouscontract.html" target="_blank">there</a> (very nicely formatted thanks to <a href="http://www.manoli.net/csharpformat/" target="_blank" rel="nofollow">this great tool by manoli</a>). You can also download the Program.cs file:<br />
<a href='http://www.automated-trading-system.com/wp-content/uploads/2009/09/Program.cs'><img src="http://www.automated-trading-system.com/wp-content/uploads/2009/09/Program.cs.jpg" alt="Program.cs" title="Program.cs" width="162" height="58" class="aligncenter size-full wp-image-287" /></a></p>
<p><strong>Note</strong>: You can receive a <a href="http://www.automated-trading-system.com/csi" target="_blank" rel="nofollow">10% discount on CSI data subscriptions</a> (use coupon code LIBERTY)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/unfair-advantage-api-code-c-extract-futures-continuous-data/feed/</wfw:commentRss>
		<slash:comments>0</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 [...]]]></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>
<p><strong>Note</strong>: You can receive a <a href="http://www.automated-trading-system.com/csi" target="_blank" rel="nofollow">10% discount on CSI data subscriptions</a> (use coupon code LIBERTY)</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>
		<item>
		<title>Balsara: Money Management Strategies for Futures Traders</title>
		<link>http://www.automated-trading-system.com/balsara-money-management-strategies-for-futures-traders/</link>
		<comments>http://www.automated-trading-system.com/balsara-money-management-strategies-for-futures-traders/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 11:37:01 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Futures]]></category>
		<category><![CDATA[Money Management]]></category>
		<category><![CDATA[Balsara]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=306</guid>
		<description><![CDATA[Over the weekend I finished this pleasant and instructive book… Over time I am aiming to build a library reference on this blog with a summary of all the books I have found useful. The idea is to be able to recall quickly the main points of the book. Hopefully you will find it useful [...]]]></description>
			<content:encoded><![CDATA[<p>Over the weekend I finished this pleasant and instructive book…<br />
Over time I am aiming to build a library reference on this blog with a summary of all the books I have found useful. The idea is to be able to recall quickly the main points of the book. Hopefully you will find it useful too!<br />
Please find below the first instalment of this category:<br />
<a rel="nofollow" href="http://www.automated-trading-system.com/money-management-balsara" target="_blank"><img class="aligncenter size-full wp-image-312" style="float: left; margin-right:12px;" title="balsara-money-management-futures-traders" src="http://www.automated-trading-system.com/wp-content/uploads/2009/09/balsara.jpg" alt="balsara-money-management-futures-traders" width="280" height="385" /></a>This book presents several basic but nonetheless important topics in Money Management. It is very accessible from a mathematical point of view and has some good reviews on <a rel="nofollow" href="http://www.automated-trading-system.com/money-management-balsara" target="_blank">amazon</a>. The book is not directly aimed at Systems trading but Money Management being a pillar of a successful mechanical trading system, it is of utmost relevance.<br />
The book starts off with an introduction of what is Money Management. It then goes straight into one of the most valuable &#8220;assets&#8221; in the book:</p>
<h3>Dynamics of Ruin</h3>
<p>Based on several factors, some of which must be derived from historical backtests, one can simulate <span id="more-306"></span>the risk of ruin taken by pursuing a specific trading strategy.</p>
<p>Risking 20% of your capital in a strategy with the following characteristics:<br />
- Payoff ration: 2x<br />
- Probability of success: 60%<br />
would result in a risk of ruin of 2%.</p>
<p>The book provides multiple tables with many combinations of parameters. This is very useful as each case needs to be simulated with 100,000 iterations (as opposed to being calculated using a formula).The simulation program code is also provided in appendix (A &amp; B) if you are inclined to re-implementing it.</p>
<h3>Diversification</h3>
<p>There is also a part on correlation and diversification. However that party seems inspired by the same conventional approach of the use of variance/co-variance as a measure of risk as applied in the <a rel="nofollow" href="http://en.wikipedia.org/wiki/Modern_portfolio_theory" target="_blank">Modern Portfolio Theory by Markowitz</a>. I would suggest reading <a rel="nofollow" href="http://www.automated-trading-system.com/Mandelbrot-misbehavior" target="_blank">Mandelbrot: The (mis)behavior of Markets</a> for a good <span style="text-decoration: line-through;">debunking</span> reality check on that theory and why it <span style="text-decoration: line-through;">does</span> might not work.<br />
In any case I am slightly suspicious of relying too much on diversification. As Taleb puts it and as the markets showed us in the 2008 &#8220;great markets collapse&#8221;: &#8220;Diversification works until you really need it&#8221; (meaning that in case of severe crises where you need most risk reduction, all correlation tends towards 1 increasing the damage).</p>
<h3>Market Selection</h3>
<p>The chapter on Market selection (pg 80) introduces the Commodity Selection Index by Welles Wilder. This could be useful as a signal filter on a trend-following system for example</p>
<h3>Stops</h3>
<p>Balsara also covers stops and introduces a novel (to me!) approach compared to the standard techniques (time, volatility and dollar-based stops).</p>
<p>The novel approach (pg 98) consists of analysing the historical drawdowns of profitable trades and derive a cutoff to be used as a stop-loss. That could prove interesting and dynamic approach to setting stop-loss. I am definitely taking that idea away from this book and will try it on a trading system.</p>
<h3>Locked-limit markets</h3>
<p>Imaging you have just entered a short position in Oil and Iran sends a nuclear bomb on Israel. The next day oil goes through the roof and stays limit-up for a week. This is a nightmare situation for any trader as there is no way to exit your position (at any cost!). Balsara explains (pg 107) how to deal with locked-limit markets (hint: use options to create a synthetic contract).</p>
<h3>Exposure and Capital</h3>
<p>The later parts of the book touch on controlling exposure and allocating capital. This is mostly derived from Markowitz MPT theory and Ralph Vince&#8217;s Optimal f and Money Management strategies. I am planning to read Ralph Vince to get it &#8220;straight from the horse&#8217;s mouth&#8221; and will address these topics at that stage.</p>
<h3>Conclusion</h3>
<p>Not a bad book, not outstanding either. Additional parts of the book are interesting but not so relevant to Systems trading (Chart patterns, Psychology and discipline). A fairly quick read with 2 or 3 good points to take away, which could move your automated trading systems development forward &#8211; so I would still recommend it for your library.<br />
<a rel="nofollow" href="http://www.automated-trading-system.com/money-management-balsara" target="_blank"><img class="aligncenter size-full wp-image-312" title="balsara-money-management-futures-traders" src="http://www.automated-trading-system.com/wp-content/uploads/2009/09/balsara.jpg" alt="balsara-money-management-futures-traders" width="110" height="150" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/balsara-money-management-strategies-for-futures-traders/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Continuous Contract options</title>
		<link>http://www.automated-trading-system.com/continuous-contract-options/</link>
		<comments>http://www.automated-trading-system.com/continuous-contract-options/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 19:26:19 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Futures]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Continuous contract]]></category>
		<category><![CDATA[CSI]]></category>
		<category><![CDATA[screenshots]]></category>
		<category><![CDATA[Unfair Advantage]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=188</guid>
		<description><![CDATA[As mentioned previously in What everybody ought to know about continuous Futures contracts, there are multiple ways to concatenate Futures contracts. Unfair Advantage offers a rich choice of concatenation algorithms &#8211; I will use UA as the base for this post. Please also refer to the Unfair Advantage online manual. Let&#8217;s look at the different [...]]]></description>
			<content:encoded><![CDATA[<p>As mentioned previously in <a href="http://www.automated-trading-system.com/what-everybody-ought-to-know-about-continous-futures-contracts" target="_blank">What everybody ought to know about continuous Futures contracts</a>, there are multiple ways to <strong>concatenate Futures contracts</strong>. Unfair Advantage offers a rich choice of concatenation algorithms &#8211; I will use UA as the base for this post.<br />
Please also refer to the <a rel="nofollow" href="http://www.csidata.com/custserv/onlinehelp/OnlineManual/" target="_blank">Unfair Advantage online manual</a>.</p>
<div id="attachment_224" class="wp-caption alignnone" style="width: 470px"><img class="size-full wp-image-224" title="Copper Continuous Contract" src="http://www.automated-trading-system.com/wp-content/uploads/2009/09/Corn-Continuous-Contract.jpg" alt="Continuous contracts allow you to chart Futures contract prices in one long time-series (here Copper ranging from 1965 to 2009)" width="460" height="193" /><p class="wp-caption-text">Continuous contracts allow you to chart Futures contract prices in one long time-series (here Copper ranging from 1965 to 2009)</p></div>
<p>Let&#8217;s look at the different possibilities:</p>
<h3>Non-adjusted contracts</h3>
<p>Take the front-month contract (nearest expiration date) and roll it over into the next one at expiration date. This generates a series of actual traded prices. But <span id="more-188"></span>as we discussed in our previous post, it does have negative impacts when used for back-testing because of the potential big gaps at roll-over times.</p>
<h3>Standard Back-Adjusted contracts</h3>
<p>A solution to this &#8220;big gap&#8221; problem is to move each contract up or down by a certain amount (the gap value) so that the rollover junction is continuous. This is <em>point-based adjustment</em> and is usualy performed &#8220;backwards&#8221;. You would start from the current contract, move the previous contract by a set amount, then subsequently move each of the anterior contracts to eliminate each gap you come across until the first contract of the timeseries.</p>
<h3>Proportionally Back-Adjusted contracts</h3>
<p>But as we saw in the last post, this <em>point-based adjustment</em> is not ideal either, as it loses the relative price differences and can even make past prices become negative. This is where <em>ratio-based adjustment</em> comes to the rescue.<br />
By applying a relative or <em>proportional</em> adjustment for each contract you will be able to maintain the historical price ratios and rid remove the gaps. This is equivalent to stock split adjustments in the Equities world. This is also done backwards &#8211; starting from the most recent contract going back, one by one, to the first contract in the series.<br />
Again, please check <a href="http://www.automated-trading-system.com/what-everybody-ought-to-know-about-continous-futures-contracts" target="_blank">the last post</a> for more details on the issues discussed above.</p>
<h3>Forward-Adjusted contracts</h3>
<p>Both <em>point-based adjustment</em> and <em>ratio-based adjustment</em> are usually worked out backwards &#8211; this allows to keep reference of the real/actual traded price in the current contract. However the same logic can be applied forward (start from the first contract and adjust your way up to the last contract). This will result in different contract values to back-adjusted contracts (but ratios would stay identical in case of proportional adjustments).</p>
<h3>Nth Nearest contracts</h3>
<p>This is a slight variation to all cases discussed above. Instead of always considering the nearest contract (ie front-month), you can decide to look at the <em>nth nearest</em> contract instead. For example, in Copper, the 3rd nearest contract is currently March 2010: HGH10. Once the current front-month contract expires (October 2009: HGV09), you would roll into the next available 3rd nearest contract which is May 2010: HGK10.<br />
This process should insulate you from possible more volatile price changes in the front-month contract around expiration time.</p>
<h3>Gann contract</h3>
<p>Gann contracts use a specific contract month and roll over only to the same contract in the next year. A March Gann contract, for example, consists of the nearest March contract for each day.</p>
<h3>Perpetual Contracts™</h3>
<p>This is an algorithm trademarked by CSI. To avoid the &#8220;gap&#8221; problem around rollover time, CSI have decided to smooth the transition phase out. The shift from one contract to the next one(s) spreads over time. The algorithm uses a time-weighted average of different expiration date contracts to gradually shift from the front-month to the further month as expiration date approaches. You can find more details <a rel="nofollow" href="http://www.csidata.com/cgi-bin/getManualPage.pl?URL=perpetualcontract(r)charts.htm" target="_blank">in the UA manual</a>.</p>
<h3>Other parameters: when to roll-over?</h3>
<p>You can roll-over right at expiration time. However this does not reflect actual trading activity, where physical roll-over (ie money flowing from one contract to the next) takes place earlier.<br />
You can decide to always roll-over n days before expiration but you can also decide to track actual market activity to trigger the roll-over. You would observe Open interest or Volume and roll-over when one of them shifts from one contract to another. This is a much more realistic approach.</p>
<p>Here is a screenshot of the settings I have used in Unfair Advantage to extract and concatenate the data, it is proportionally forward-adjusted with a roll-over triggered by a 2 consecutive shifts in Open Interest, but less than 5 days prior to expiration:</p>
<div id="attachment_196" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-196" title="Unfair Advantage Proportionally Forward-Adjusted Contract" src="http://www.automated-trading-system.com/wp-content/uploads/2009/09/UnfairAdvantage-Proportionally-Forward-Adjusted-Contract.jpg" alt="Unfair Advantage settings to generate a Proportionally Forward-Adjusted Contract " width="500" height="354" /><p class="wp-caption-text">Unfair Advantage settings to generate a Proportionally Forward-Adjusted Contract</p></div>
<h3>To be continued&#8230;</h3>
<p>There are many more options which will all be addressed in a further post detailing how to use the Unfair Advantage API to extract data directly from your own code (Exciting!).</p>
<p><strong>Note</strong>: You can receive a <a href="http://www.automated-trading-system.com/csi" target="_blank" rel="nofollow">10% discount on CSI data subscriptions</a> (use coupon code LIBERTY)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/continuous-contract-options/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

