<?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; Strategies</title>
	<atom:link href="http://www.automated-trading-system.com/category/strategies/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>Futures Trading and Small Account</title>
		<link>http://www.automated-trading-system.com/futures-trading-and-small-account/</link>
		<comments>http://www.automated-trading-system.com/futures-trading-and-small-account/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 03:12:42 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Futures]]></category>
		<category><![CDATA[Money Management]]></category>
		<category><![CDATA[Strategies]]></category>
		<category><![CDATA[diversification]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=4144</guid>
		<description><![CDATA[I recently spent more time doing &#8220;reading research&#8221; rather than &#8220;testing research&#8221;. As result, this post resembles a collection of links on ideas seen on the web of how to trade futures with a small account &#8211; one of the topics I have been interested in. The Issue: Diversification with Small Account A small account [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2011/07/Starling-swarm-midlander1231b.jpg" alt="" title="Starling swarm - midlander1231b" width="266" height="400" class="alignnone size-full wp-image-4146" /></p>
<p>I recently spent more time doing &#8220;reading research&#8221; rather than &#8220;testing research&#8221;. As result, this post resembles a collection of links on ideas seen on the web of <strong>how to trade futures with a small account</strong> &#8211; one of the topics I have been interested in.</p>
<h3>The Issue: Diversification with Small Account</h3>
<p>A small account size &#8211; or starting equity &#8211; can make it difficult to achieve diversification (<em>a &#8220;free lunch&#8221; with a high &#8220;cover charge&#8221;</em> as described in <a href="http://www.automated-trading-system.com/futures-vs-etfs/">this post</a> &#8211; you can read more on diversification and correlation from this blog <a href="http://www.automated-trading-system.com/trading-diversification-free-lunch/">here</a> and <a href="http://www.automated-trading-system.com/the-good-the-bad-and-the-ugly-portfolios/">here</a>).</p>
<p><strong>Diversification</strong> can be achieved by trading a large number of components in a portfolio, whether &#8220;components&#8221; represent:</p>
<ul>
<li>Instruments</li>
<li>Systems</li>
<li>Timeframes</li>
</ul>
<h3>Instruments Diversification</h3>
<p>&#8220;Instruments&#8221; is usually the first aspect that comes to mind when thinking about diversification.<br />
Including more assets/markets/instruments in a portfolio is often described as the &#8220;free lunch&#8221; &#8211; and this is one of the main reasons why large CTAs often include upwards of 100 markets in their portfolio selection.</p>
<p>A small account most likely cannot trade a portfolio of 100+ instrument. This is an issue that <span id="more-4144"></span>Dean Hoffman tries to address in this article: <a href="http://www.hoffmanassetmanagement.com/?p=68" rel="nofollow" target="_blank">The Conundrum of Small Managed Futures Accounts</a>.</p>
<p>Noting that most <em>diversified</em> trend follower CTAs have a minimum account size of at least $1M, Hoffman describes the advantages of trading larger accounts (able to trade many instruments including those with high margin requirements, more granular position sizing with contract scaling).</p>
<p>Hoffman then describes <strong>Dynamic Portfolio Selection</strong> as a potential solution for small accounts to achieve increased results from a &#8220;virtual high diversification&#8221;. The system monitors a large set of instruments but instead of taking all signals (as a diversified trend follower would most likely do), it evaluates and ranks each instrument relatively (based on each market&#8217;s potential on a risk-adjusted basis), resulting in about 90% of trading signals being filtered out. This naturally cuts down the number of positions held at the same time, and consequently the required account size.</p>
<p>As this is mostly a &#8220;marketing&#8221; article for Hoffman&#8217;s CTA offering (implementing this concept), there is not much more information on what sort of filtering is applied to select the &#8220;best&#8221; signals but the general idea is worth investigating (and you can check for yourself whether their performance seems to hold up against the theory).</p>
<p>The subject of dynamic portfolio selection has also been covered in the inevitable <a href="http://www.tradingblox.com/forum/index.php" rel="nofollow" target="_blank">Trading Blox forums</a> in this <a href="http://www.tradingblox.com/forum/viewtopic.php?p=15743" rel="nofollow" target="_blank">&#8220;Dynamic Portfolio Selection&#8221; post</a> started by Dean Hoffman himself.</p>
<p>A couple of posts on this blog also describe potential filtering ideas based on <a href="http://www.automated-trading-system.com/volatility-filters/">relative market volatility</a> and <a href="http://www.automated-trading-system.com/trade-with-the-big-trend/">higher-level trend direction</a>.</p>
<p>This idea of filtering trades is not new: the Turtles used to use the concept decades ago, as mentioned by TB forum user sluggo in <a href="http://www.tradingblox.com/forum/viewtopic.php?p=44931&#038;highlight=skip+turtles#44931" rel="nofollow" target="_blank">this post</a> (which contains a link to Trading Blox code implementing similar &#8220;heat limitation&#8221; mechanism).</p>
<h3>Systems (and Timeframes) Diversification: Swarm Behaviour</h3>
<p>Combining several systems is also a possibility to achieve diversification. With the extra advantage that it is possible &#8211; to some extent &#8211; to design systems and control their correlations to the rest of the suite of systems (as opposed to markets, which can have a furious tendency to correlate to +1 or -1 during crisis times).</p>
<p>And as we all know, <strong>correlation is a key element of the &#8220;diversification benefits&#8221; equation</strong> (check <a href="http://www.tradingblox.com/forum/viewtopic.php?t=8342" rel="nofollow" target="_blank">this thread</a> from user sluggo on TB forums for a good presentation/discussion on the topic).</p>
<p>Adding a profitable mean reversion/counter-trend system to a trend following system will, in all likelihood, reduce the volatility of the combined portfolio, thanks to the negative correlation that it brings. Adding many uncorrelated systems is likely to increase this positive effect.</p>
<p>However, trading a diversified suite of systems has a similar constraint to trading a large portfolio: it increases the required account equity.</p>
<p>A comment from <em>Pumpernickel</em> on a recent <a href="http://quantumfinancier.wordpress.com/2011/04/24/one-size-does-not-fit-all/" rel="nofollow" target="_blank">post from Quantum Financier</a> (who is starting a series of posts on &#8220;signal aggregation: <em>how we form and use an ensemble of signals isolating different pieces of information to build a profitable strategy</em>&#8221; ) pointed to a couple of documents from Fall River Capital. </p>
<p>The (pdf) document (<a href="http://www.fallrivercapital.com/documents/AnatomyofaSwarmPart1_003.pdf" rel="nofollow" target="_blank">part 1</a> and <a href="http://www.fallrivercapital.com/documents/AnatomyofaSwarmPart2_003.pdf" rel="nofollow" target="_blank">part 2</a> of their white paper) describe how they tackle this issue on a large scale, by trading hundreds to thousands systems simultaneously, using the concept of <a href="http://en.wikipedia.org/wiki/Swarm_behaviour" rel="nofollow" target="_blank">swarm behaviour</a> (which can be seen throughout the natural world, such as in the mesmerising starling flights in the English Somerset Winter, pictured above).</p>
<p>From the white paper (other <a href="http://www.fallrivercapital.com/WhitePapers.html" rel="nofollow" target="_blank">Fall River white papers</a> and general website are also interesting to read): </p>
<blockquote><p>An […]  approach is to assign each trading system a vote. Each model is polled for its position (long, short, or out) daily, and the total is aggregated into a tally that may be thought of as a “Vox Populi,” or crowd opinion poll. Research showed that aggregating the systems by this simple tally method was a quite workable approach, allowing us to “cheat” by holding a single position per market rather than hundreds or thousands. Regardless of the number of component models, the master strategy holds a position in accordance with the majority of the crowd.</p></blockquote>
<p>How they choose the models/systems to be included in the portfolio is mostly driven by  each system&#8217;s correlation to other systems:</p>
<blockquote><p>The portfolio of individual candidate systems consists of between several hundred and a few thou‐ sand members that share both low correlations to one another and robust returns over many years of market history. The result is a “swarm” of trading models, each attacking the market from a different direction. This process of system development, evaluation, and selection does not prioritize superior standalone system performance, but rather seeks to uncover profitable trading rules that complement one another when implemented together.
</p></blockquote>
<p>Their testing results seem to show that this approach tracks fairly well an &#8220;equal allocation&#8221; approach with hundreds/thousands of systems, which itself benefits greatly from low correlated system diversification (reduced volatility, or increased vol-adjusted returns).</p>
<p>This &#8220;systems voting&#8221; strategy has also been discussed on the TB forums <a href="http://www.tradingblox.com/forum/viewtopic.php?t=8606" rel="nofollow" target="_blank">there</a> (again started by user sluggo&#8230;).</p>
<h3>Other Alternatives</h3>
<p>These are ideas to stimulate research on how to alleviate the <strong>&#8220;futures trading diversification with a small account&#8221;</strong> issue. Other ideas can also be found on other threads from the TB forum (examples <a href="http://forum.tradingblox.com/viewtopic.php?t=2359&#038;postdays=0&#038;postorder=asc&#038;start=0" rel="nofollow" target="_blank">1</a>, <a href="http://www.tradingblox.com/forum/viewtopic.php?p=46943#46943" rel="nofollow" target="_blank">2</a> and <a href="http://www.tradingblox.com/forum/viewtopic.php?t=8164&#038;start=0&#038;postdays=0&#038;postorder=asc&#038;highlight=" rel="nofollow" target="_blank">3</a> &#8211; search the forum for more discussions), showing that the topic is a &#8220;popular&#8221; one.</p>
<p>Another alternative would be to move away from trading actual futures but instead focus on &#8220;proxy&#8221; instruments such as ETFs (see <a href="http://www.automated-trading-system.com/etf-v-futures-a-quantification/">this post for a quantification of how ETFs can track futures</a>) or spread betting (they usually offer lower minimum trading lots, allowing for lower required trading equity, but can have other disadvantages, such as counterparty risk, less instruments available or cost of funding/leverage). Another trade-off to make in system/strategy design..<br />
&nbsp;</p>
<div style="font-size: 0.8em;">Picture credits: <a href="http://www.flickr.com/photos/tonyarmstrong/5381370808/" rel="nofollow" target="_blank">midlander1231</a> via flickr (CC)</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/futures-trading-and-small-account/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Some Complications of Monthly Trading</title>
		<link>http://www.automated-trading-system.com/some-complications-of-monthly-trading/</link>
		<comments>http://www.automated-trading-system.com/some-complications-of-monthly-trading/#comments</comments>
		<pubDate>Wed, 18 May 2011 08:22:06 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Equities]]></category>
		<category><![CDATA[Strategies]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=4125</guid>
		<description><![CDATA[I was recently looking at monthly momentum/rotation trading systems with stocks. The concept seems to have become quite popular in the blogosphere in the last few years. See this earlier post for another monthly trading discussion The generic concept for a rotation strategy is usually fairly simple: pick a relatively large set of instruments, calculate [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2011/05/Calendar2.jpg" alt="" title="Calendar" width="418" height="350" class="alignnone size-full wp-image-4126" /></p>
<p>I was recently looking at monthly momentum/rotation trading systems with stocks. The concept seems to have become quite popular in the blogosphere in the last few years. See this earlier post for another <a href="http://www.automated-trading-system.com/trade-monthly-basis/">monthly trading discussion</a></p>
<p>The generic concept for a <strong>rotation strategy</strong> is usually fairly simple: pick a relatively large set of instruments, calculate a <strong>monthly ranking</strong> (based on 1-month, 6-month returns, etc. or a combination of several monthly returns and/or other factors) and allocate your equity to the <em>top N </em>instruments. Repeat every month by selling instruments that have fallen out of the <em>top N</em> and by buying new entrants.</p>
<p>The system appears simple enough to operate and to backtest, but as with everything, <em>the devil is in the details</em>.<br />
There is of course <em>other devil in other details</em>: rebalancing, volatility consideration, position sizing, etc. are not taken into account in this simple model &#8220;description&#8221; and the discussion below.</p>
<h3>Using Monthly Close data</h3>
<p>Lots of (free) historical data &#8211; going back far enough for relevant back-testing &#8211; only contains monthly closes. The usual assumption made when backtesting using this type of data is to use the monthly closing price to generate the entry/exit signals as well as for the entry/exit prices themselves. Operationally, this is obviously not possible: you cannot wait for market close to get prices and generate signals, then go back to trade at market close. </p>
<p>This is one of the reasons <span id="more-4125"></span>backtesting software such as Trading Blox does not allow to trade at today&#8217;s close &#8211; although this &#8220;safeguard for realistic results&#8221; can be overridden if need be (using a command such as <code>order.SetFillPrice(instrument.close[1])</code> in script <code>Can Fill Price</code>).</p>
<p><strong>Using monthly close data only</strong> is not necessarily &#8220;wrong&#8221; but represents an approximation one has to be aware of. A workaround might be to get prices x minutes before the close  to generate signals and send <em>&#8220;Market on Close&#8221;</em> orders before trading terminates &#8211; with the potential risk that market moves in these last monthly closing minutes would change the actual ranking and signal generation (giving different live trading and backtesting results). </p>
<p>Another workaround might be to actually trade on open the next day; the difference between live trading and backtesting results then being the difference between the monthly closing price and monthly open price &#8211; which could be costly in terms of missed performance when considering the <a href="http://www.cxoadvisory.com/calendar-effects/the-turn-of-the-month-effect/" target="_blank" rel="nofollow">turn of the month effect</a>.</p>
<p>Using <strong>OHLC Monthly data</strong> might avoid this approximation in backtesting, by allowing the use of Close for ranking/signal generation and Open for entry/exit price.</p>
<p><em>Note</em>: for <strong>historical data sources</strong> (including free ones), fellow bloggers Mebane Faber and Mike Stokes have compiled lists on their respective blogs <a href="http://www.mebanefaber.com/2010/01/26/free-historical-data-sources/" target="_blank">World Beta</a> and <a href="http://marketsci.wordpress.com/2010/11/04/faq-free-data-sources/" target="_blank">MarketSci</a>. A new-coming website <a href="http://wikiposit.org/w" target="_blank" rel="nofollow">Wikiposit</a> seems also very promising for all sorts of free data.</p>
<p>On my side, I use and am pretty pleased with <a href="http://www.automated-trading-system.com/csi" target="_blank" rel="nofollow">CSI</a>, which gives me access to the full history of World Futures and World Stocks, and allows for several data aggregation periods (daily, weekly, monthly, etc.) with different back-adjustment options for futures.</p>
<h3>Different Monthly Opening/Closing Dates</h3>
<p>Another complication could come from a portfolio of instruments trading in different locations: Monthly open/close might occur on <strong>different dates for different instruments</strong> (ie. different markets close on different days depending on the local holidays of the exchanges).</p>
<p>Assume that some instruments do not trade for the last global business day of the month: it is then clearly impossible to trade at the monthly closing price when generating trading signals on the last day of the month &#8211; making the x-minutes-before-close workaround impossible to implement, and increasing the backtesting approximation.</p>
<p>Again, using monthly OHLC data and the open price as entry price would prevent this issue. </p>
<p>Another case, which might cause an issue, relates to <strong>different monthly open dates</strong>. Imagine trading a rotation system, which is invested in the top 10 ranking stocks:<br />
Every month the system would sell the stocks that have fallen out of the top 10 and use the proceeds to finance the purchase of the new entrants in the top 10 (assuming no use of leverage: ie. the system can only buy after selling, when invested at 100%).<br />
If some of the &#8220;Sell&#8221; instruments do not trade on the first global business day of the month (local exchange on holiday or other reason), the new purchases will be under-funded, with a decision to be made as to how to partially allocate across the new entrants, until full funding is available. This would mean that start-of-month returns from new additions would not be fully captured by the system.</p>
<p>The use of daily OHLC data with a more sophisticated backtesting logic would be required to reflect this logic in the simulation results. A more automated (than manual) order execution would also require a more complex algorithm defining how to handle these cases and being aware of non-trading days.</p>
<p>Of course, this issue can be largely avoided by choosing a set of instruments all trading in the same &#8220;holiday jurisdiction&#8221;.</p>
<p>Note that the margin constraint would generate another issue related to the <strong>delta between prices used for order sizing</strong> (monthly close prices)<strong> and order execution</strong> (monthly open prices). </p>
<p>A &#8220;jump&#8221; in prices might result in the total allocation going over 100% of equity. A buffer to allow for price variations is probably required when calculated signal and position sizes for the next day, at the risk of being slightly under-allocated every month. Some testing would point to the &#8220;most optimal&#8221; buffer size to limit over-allocation without reducing the overall average allocation too much.</p>
<h3>Not Only Relevant to Monthly Systems</h3>
<p>Quite a few of these issues actually apply to systems that trade on various frequencies, not necessarily on a monthly basis. As for every model or testing procedure, it is always good to be aware of assumptions and limitations. </p>
<p>One has to get a feel for the related issues to decide whether one can live with the resulting approximations in their backtests, or whether more realistic results are worth the extra effort in developing backtesting logic and operational procedures.</p>
<p>&nbsp;</p>
<div style="font-size: 0.8em;">Picture credits: vbecker via flickr (CC)</div>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/some-complications-of-monthly-trading/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Trend Following, &#8220;Monkey Style&#8221;</title>
		<link>http://www.automated-trading-system.com/trend-following-monkey-style/</link>
		<comments>http://www.automated-trading-system.com/trend-following-monkey-style/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 13:43:24 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Strategies]]></category>
		<category><![CDATA[random]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=4063</guid>
		<description><![CDATA[A while ago, I used a quote from Winton manager and trend Follower David Harding (found in this interview) saying: If you put in stops and run your profits and trade randomly you make money; and if you put in targets and no stops, and you trade randomly you lose money. So the old saw [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2011/03/monkeys-+-darts-by-trevira.jpg" alt="" title="monkeys + darts by trevira" width="270" height="307" class="aligncenter size-full wp-image-4064" /><br />
<a href="http://www.automated-trading-system.com/why-trend-following-works-look-at-the-distribution/">A while ago</a>, I used a quote from Winton manager and trend Follower David Harding (found in <a href="http://www.thehedgefundjournal.com/magazine/200509/interviews/simon-kerr-talks-to-david-harding.php" target="_blank" rel="nofollow">this interview</a>) saying:</p>
<blockquote><p>If you put in stops and run your profits and trade randomly you make money; and if you put in targets and no stops, and you trade randomly you lose money. So the old saw about cutting losses and running profits has some truth to it.</p></blockquote>
<p>The quote was used to illustrate a post stating that a large driver of Trend Following returns is based on the mechanics of those systems (&#8220;<em>cut your losses short, let your winners run</em>&#8220;) which therefore benefit from the right tail of market return distributions &#8211; which are &#8220;fatter&#8221; than the usually assumed normal distribution &#8211; and avoid the left tail.</p>
<p><strong>&#8220;Trade randomly&#8221;</strong>? Like the proverbial <strong>dart-throwing monkey</strong>? It seems so&#8230;<br />
In effect, Harding is saying that entry points do not matter so much: a random entry coupled with a smart exit strategy would make money.</p>
<h3>Random Trading To the Test</h3>
<p>I once met with a fund manager, who described his strategy as very similar to that random system in the Harding quote. What was really important to them was the position sizing for each new signal, as well as the exit strategy. <strong>The entry signal direction was &#8220;irrelevant&#8221;</strong>. </p>
<p>I found this puzzling at the time and have been wanting to test this idea since then, to verify whether a &#8220;random trading&#8221; system could indeed be profitable. </p>
<p>The system tested here is composed of <span id="more-4063"></span><strong>random entries</strong> with additional &#8220;classic&#8221; components: a volatility-based fixed fractional money management and volatility-based trailing stop exits.</p>
<ul>
<li>The system first &#8220;tosses a coin&#8221; to decide whether to go long or short the market. </li>
<li>An initial stop is set below/above the entry price at a distance equal to a fixed multiple of the volatility measure. </li>
<li>That entry-stop distance is used to calculate the position size, so that the risk per trade (amount lost if trade gets stopped out) is equal to the fixed percentage of account equity.</li>
<li>Every day, the trailing stop is adjused so that it is never further than the fixed multiple of the volatility measure. The stop always gets closer to the market and never gets adjusted further away from the market (i.e. if the market turns back toward the stop, the stop level does not change).</li>
<li>When the position hits the trailing stop level, it gets closed and a new position is open. The direction of that new position is again determined by a new coin-toss.</li>
</ul>
<h3>Test Parameters and Results</h3>
<p>For this test, I used fairly standard parameter values:</p>
<ul>
<li>Volatility Measure: 39-day (exponential) ATR</li>
<li>Stop Distance: 2 ATR</li>
<li>Risk per Trade: 1% of Account Equity</li>
</ul>
<p>The portfolio used for this test is a subset of the one used in the <a href="http://www.automated-trading-system.com/resources/state-trend-following/">State of Trend Following report</a>, basically all those instruments that I have data for going back to the start of the test: in January 1990 (click for the <a href="http://autrasy.wpengine.netdna-cdn.com/wp-content/uploads/2011/03/Instruments.html">exact list</a>).</p>
<p>Since this is a random experiment, I generated multiple test outputs (200), all based on the same parameters, and averaged their monthly returns to create a composite equity curve, which performance summary statistics can be seen below:</p>
<table style="border:1px solid #c3c3c3; border-collapse:collapse;">
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;" colspan="2">
      Performance Stats
    </th>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
CAGR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">18.11%</div>
</td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Max DD
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">33.57%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
MAR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
0.54
    </td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Monthly Std Dev
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">6.34%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
Average Monthly Rtn
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">1.59%</div>
</td>
</tr>
</table>
<p>&nbsp;<br />
The 2-ATR stop level is somehow an arbitrary choice and I wanted to check whether this bore an impact on the test results.</p>
<p>I ran a further test, stepping the ATR-multiple for stop calculation from 2 to 10. Each ATR-multiple set was run 200 times again and averaged to give a composite equity curve.<br />
Normalizing these 9 composite equity curves (for equal monthly standard deviation) and averaging them produced a &#8220;super-composite&#8221; equity curve composed of 2000 random tests (equally split between ATR-multiples ranging from 2 to 10).</p>
<p>The performance summary statistics of this &#8220;super-random-composite&#8221; equity curve are below:</p>
<table style="border:1px solid #c3c3c3; border-collapse:collapse;">
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;" colspan="2">
      Performance Stats
    </th>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
CAGR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">16.46%</div>
</td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Max DD
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">21.87%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
MAR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
0.75
    </td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Monthly Std Dev
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">5.67%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
Average Monthly Rtn
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">1.44%</div>
</td>
</tr>
</table>
<p>&nbsp;<br />
Note how the diversification and rebalancing over several ATR-multiple stop levels have a substantial impact on the Max Drawdown and volatility.</p>
<p>Both equity curves are charted below:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2011/03/Equity-Curve.png" alt="" title="Equity Curve" width="493" height="371" class="alignnone size-full wp-image-4065" /></p>
<p>All in all, not too bad for &#8220;monkey-style&#8221; trading! It goes to show that signal entries, which most beginning traders/system developers focus so much on, are not so important after all&#8230;</p>
<p>Update: follow-up post tackling other aspects of randomness in trading systems and clarifying subjects such as averaging and commissions/slippage: <a href="http://www.automated-trading-system.com/further-musings-on-randomness">Further Musings on Randomness</a><br />
&nbsp;<br />
&nbsp;<br />
<a name="credits"></a><em>Credits/Additional Reading</em>: The concept of random entries with trailing stops has actually been discussed before. It seems like it was introduced by Van Tharp in his <a href="http://www.amazon.com/exec/obidos/ASIN/007147871X/autotradblog-20" target="_blank" rel="nofollow">Trade your Way to Financial Freedom book</a>, and mentioned on <a href="http://www.tradejuice.com/system-trading/trailing-stops-chandelier-clb.htm" target="_blank" rel="nofollow">this article</a> by Chuck Le Beau, where he expands on the concept of &#8220;Chandelier Exit&#8221; (name for volatility-based trailing stops).<br />
Thanks and credits also to user &#8220;sluggo&#8221; on the Trading Blox forum, who published a <a href="http://www.tradingblox.com/forum/viewtopic.php?p=25946&#038;highlight=#25946" target="_blank" rel="nofollow">similar study</a> four years ago, and some code which I reused most of for this study. Note that his study found an opposite result, showing a turn in profitability (downwards) of random systems after 1997 (portfolio and parameter values are different though), so you might want to run your own test to verify this concept for yourself&#8230;<br />
&nbsp;</p>
<div style="font-size: 0.8em;">Picture credits: Trevira via flickr (CC)</div>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/trend-following-monkey-style/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
		<item>
		<title>How to Start Trading a New System?</title>
		<link>http://www.automated-trading-system.com/start-trading-new-system/</link>
		<comments>http://www.automated-trading-system.com/start-trading-new-system/#comments</comments>
		<pubDate>Thu, 03 Feb 2011 11:13:04 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Strategies]]></category>
		<category><![CDATA[Backtest]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=3978</guid>
		<description><![CDATA[Today is the big day&#8230; After months or years of research, your trading system is finally deemed ready for production, and the latest back-test shows open trades as of yesterday (from earlier signals). How do you handle these positions in your new system today? You have two basic options: Skip these positions and only enter [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2011/02/start-nickuzma2.jpg" alt="start" title="start" width="350" height="199" class="alignnone size-full wp-image-3983" /></p>
<p>Today is the big day&#8230;</p>
<p>After months or years of research, your trading system is finally deemed ready for production, and the latest back-test shows open trades as of yesterday (from earlier signals). How do you handle these positions in your new system today?</p>
<p>You have two basic options:</p>
<ol>
<li>Skip these positions and only enter as and when new signals arise.</li>
<li>Enter the positions today, as if your system had taken the entry signals in its past, back-tested life.</li>
</ol>
<p>The back-test did not skip any signals, as option 1 would, but neither did it enter trades in the middle of their life, as with option 2. How to decide which option to pick?<span id="more-3978"></span><br />
You could take a &#8220;middle-of-the-road&#8221; approach and decide to take the positions at only half their normal size, effectively mixing options 1 and 2, but let&#8217;s consider both options individually.</p>
<p>Option 1 takes the risk of &#8220;missing the boat&#8221; on big winners, whereas option 2 might get you in the trades at a point where heat is running at a much higher level than at typical entries.</p>
<p>With regards to this last point, please consider an extract from &#8220;<a href="http://www.automated-trading-system.com/trick-reduce-drawdowns/">A trick to reduce Drawdowns</a>&#8221; where I expanded on the concept of lifecycle of a Trend Following trade, heat, open equity risk vs. closed equity risk:</p>
<blockquote><p>
By nature, Trend Following is a strategy prone to drawdowns because of the way it waits for the trend to reverse before closing the position. On any winning Trend Following trade, there is often a lot of open equity &#8220;given back&#8221; to the market.</p>
<p>Below is an equity graph of the life of a hypothetical Trend Following trade:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/04/EquityCurves.png" alt="EquityCurves" title="EquityCurves" width="455" height="297" class="alignnone size-full wp-image-2191">
</p></blockquote>
<p>Entering a trade &#8220;half-way&#8221; carries the risk of being directly exposed to a large trade heat. What this would do is transform a potential open equity drawdown, after a profitable run, into a closed equity drawdown directly from the start of trading. Instead of having a good performance followed by a bad performance, the system would potentially suffer from negative performance from the start.</p>
<h3>Testing Both Options</h3>
<p>Apart from the starting point of the back-test, all trades are usually taken as soon as entry signals are triggered. No skipped trades and no late entries. Ideally, you would want to run tests to show where the system would stand now if you had started live trading some time ago (let&#8217;s say one year ago for example) with either option. Where would the system stand at the end of last year if you had started trading with either option two years ago, and so on.</p>
<p>In order to test this and cover a wide array of possible start dates, I ran a stepped parameter back-test with staggered testing periods, covering 1990 to 2010.</p>
<p>The system used for this test was the 20-50 Moving Average Cross-Over system featured in the <a href="http://www.automated-trading-system.com/resources/state-trend-following/">State of Trend Following report</a>.</p>
<p>About 850 tests were run, with each test starting 5 days later than the previous test and covering 1250 trading days (to allow for long running trades to complete from the start).<br />
Each test is run twice, covering options 1 and 2 for the trade start methodology.</p>
<p>The results of all tests allow for a performance comparison to try and understand which option performs better on average. Below is chart of the difference in CAGR for each test:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2011/02/CAGR-Difference1.png" alt="CAGR-Difference" title="CAGR-Difference" width="496" height="291" class="alignnone size-full wp-image-4001" /></p>
<p>The difference plotted above is absolute (a 5% absolute difference does not have the same significance if the CAGR is 10% or 100%). The average difference is -5.05% for an average CAGR of 29.9%, which gives us a better idea of the relative difference. Note that the difference is also a function of the length of the test.</p>
<p>The results seem fairly biased towards option 2 (enter all positions as soon as the system goes live), which can seem counter-intuitive from some point of view.<br />
Below is an additional chart plotting the difference in Sharpe ratio:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2011/02/Sharpe-Difference1.png" alt="Sharpe-Difference" title="Sharpe-Difference" width="494" height="295" class="alignnone size-full wp-image-4002" /></p>
<p>Some traders might still not enjoy the idea of idea of jumping on-board trades with higher heat levels. A fairly obvious solution to this would be to add stops to initial entry points only in order to reduce system heat at the start of trading. Trading a system with stops and volatility-based position sizing would also do this naturally. Either way, this could possibly represent a third option, combining the best of both worlds. Something else to test&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/start-trading-new-system/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Trading Diversification: A Free Lunch?</title>
		<link>http://www.automated-trading-system.com/trading-diversification-free-lunch/</link>
		<comments>http://www.automated-trading-system.com/trading-diversification-free-lunch/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 15:25:41 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Money Management]]></category>
		<category><![CDATA[Strategies]]></category>
		<category><![CDATA[Trend Following]]></category>
		<category><![CDATA[diversification]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=3370</guid>
		<description><![CDATA[&#160; The more I think about system design, the more I get convinced that diversification is a key to great performance. As the cliche goes: Diversification is the only free lunch on Wall Street. This is a concept equally shared by Modern Portfolio Theorists and Trend Following Wizards, who usually emphasise the concept &#8211; and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/11/diversified-hats-maiostra.jpg" alt="diversified hats" title="diversified hats" width="450" height="250" class="alignnone size-full wp-image-3372" /><br />
&nbsp;<br />
The more I think about system design, the more I get convinced that <strong>diversification </strong>is a key to great performance.</p>
<p>As the cliche goes:</p>
<blockquote><p>Diversification is the only free lunch on Wall Street.</p></blockquote>
<p>This is a concept equally shared by Modern Portfolio Theorists and <a href="http://www.automated-trading-system.com/resources/trend-following-wizards-fund-performance/">Trend Following Wizards</a>, who usually emphasise the concept &#8211; and are often quoted as trading around 100 different types of instrument, if not more.</p>
<p>The <a href="http://www.automated-trading-system.com/state-of-trend-following-october-2010/">State of Trend Following report</a> contains a decent level of diversification with around <a href="http://www.automated-trading-system.com/wp-content/uploads/2010/08/Instruments.html" target="_blank">50 instruments</a> and I wanted to use this as a base to check the <strong>impact of diversification on performance</strong>.</p>
<p>The idea is to run the same strategy using a subset of the portfolio (ie less instruments = less diversification) and see how it performs.</p>
<p>The problem, though, in selecting a subset of instruments out of the 51 in the original portfolio is that it could affect performance in the same way as any portfolio selection can (ie you could obtain vastly different results in trading the same system with two different sets of instruments, just by virtue of a &#8220;lucky&#8221; pick of strong performers).<span id="more-3370"></span></p>
<h3>Historical Performance</h3>
<p>First, let&#8217;s get a reference point and look at the historical performance of the system chosen for this test: the <strong>20-50 Moving Average system</strong>. Below is the performance back-test of that system over the last 20 years with the original portfolio:</p>
<p><a href="http://www.automated-trading-system.com/wp-content/uploads/2010/11/equity-curve-log.png"><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/11/equity-curve-log.png" alt="equity-curve-log" title="equity-curve-log" width="500" height="303" class="alignnone size-full wp-image-3382" /></a></p>
<table style="border:1px solid #c3c3c3; border-collapse:collapse;">
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;" colspan="2">
Performance Stats
    </th>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
CAGR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">29.68%</div>
</td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Max DD
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">43.60%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
MAR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
0.68
    </td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Sharpe Ratio
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
0.59
    </td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
Trade Number
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
3629
    </td>
</tr>
</table>
<p>&nbsp;</p>
<h3>Tests with Less Diversification</h3>
<p>As mentioned below, the idea is to work on a subset of instruments and compare the results with the initial portfolio. To avoid any sort of data mining/hindsight bias in the portfolio selection, I decided to run a <em>Monte-Carlo</em>-like approach to test the system with multiple instrument subset combinations: instead of picking a single portfolio subset of 25 instruments, I&#8217;ll run the system over <strong>1,000 different sub-portfolios, chosen randomly</strong>.</p>
<p>In order to get an idea of how gradually diversification affects the performance, I ran the test in three steps:</p>
<ul>
<li>sub-portfolio of 15 instruments</li>
<li>sub-portfolio of 25 instruments</li>
<li>sub-portfolio of 40 instruments</li>
</ul>
<p>All instruments are picked <strong>at random from the list of 51 instruments</strong> in the original portfolio.</p>
<p>Each of the 3,000 runs generated a full system performance record. Below are plotted the CAGR and Max Drawdown for each instance:</p>
<div id="attachment_3375" class="wp-caption alignnone" style="width: 454px"><a href="http://www.automated-trading-system.com/wp-content/uploads/2010/11/diversification-scatterplot-big.png"><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/11/diversification-scatterplot.png" alt="Click to zoom in" title="diversification scatterplot" width="444" height="342" class="size-full wp-image-3375" /></a><p class="wp-caption-text">Click to zoom in</p></div>
<p>The original system is also represented as the yellow dot.</p>
<p>Note that the &#8220;portfolio randomizer&#8221; did not account for any logic in terms of sector allocation. The original portfolio is balanced over several sectors (currencies, energies, rates, agriculturals, etc.) and there is no account for <strong>correlation </strong>between the different instruments (obviously correlation plays a big role in diversification: there is not much point in having dozens of instruments if they are all strongly correlated). However, over the large number of simulations, the main ideas of the test still come through.</p>
<p>Another point is that the only difference between the different runs were regarding the <strong>position sizing</strong> of each trade (fixed fractional), which were adjusted to obtain results of similar magnitude in each test (a portfolio with less instruments will require a slightly higher position size to match the return/drawdown rate of a portfolio with more instruments).</p>
<p>Looking at the plot chart, there are two main observations:</p>
<ul>
<li>We can see the <strong>gradual effect of diversification</strong> improving the system results by &#8220;moving&#8221; the cloud of performance points towards the left (less drawdown) and up (more return).</li>
<li>The other observation is that the <strong>more diversification</strong> there is, the <strong>lower the deviation</strong> in the system results &#8211; therefore providing more <strong>robustness </strong> and less chance of data mining impact from portfolio selection on your back-tests.</li>
</ul>
<h3>Diversification or Why the Coffee Cup Never Jumps</h3>
<p>That last point makes me think of an example discussed by Nassim Taleb in his <a href="http://www.amazon.com/exec/obidos/ASIN/1400063515/autotradblog-20" target="_blank" rel="nofollow">Black Swan</a> explaining the averaging of randomness:</p>
<blockquote><p>
Yet physical reality makes it possible for my coffee cup to jump &#8211; very unlikely, but possible. Particles jump around all the time. How come the coffee cup, itself composed of jumping particles, does not? The reason is, simply, that for the cup to jump would require all of the several trillion particles to jump in the same direction, and do so in lockstep several times in a row. This is not going to happen in the lifetime of this universe</p></blockquote>
<p>Every trade/instrument can be seen as a particle composed of a (large) random element and a smaller edge that we try to extract via a mechanical system.</p>
<p>A portfolio composed of too few instruments would be like drinking your coffee or tea from a cup made up of only a few particles: cups would be jumping around everywhere, making coffee drinking a perilous venture. Same concept applies to trading.</p>
<p>This is the way I see diversification: by adding a <strong>large number of mostly random elements</strong>, you can ensure that random moves have some <strong>cancelling effect</strong> on each other so that your &#8220;trading cup&#8221; never jumps. All that is left is to collect the small edge from all the instruments via your preferred trading strategy(ies).</p>
<p>In effect, this is how casinos operate &#8211; and with diversification you somehow get to be the house!<br />
&nbsp;<br />
&nbsp;<br />
Credits: The use of a portfolio randomizer and the display of results in a CAGR/MaxDD scatterplot was directly inspired from user sluggo on this <a href="http://www.tradingblox.com/forum/viewtopic.php?p=44839&#038;highlight=randomly#44839" target="_blank">Trading Blox forum thread</a>.<br />
&nbsp;<br />
&nbsp;</p>
<div style="font-size: 0.8em;">Hats picture credits: maiostra via flickr (CC)</div>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/trading-diversification-free-lunch/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Trade with the &quot;Big&quot; Trend</title>
		<link>http://www.automated-trading-system.com/trade-with-the-big-trend/</link>
		<comments>http://www.automated-trading-system.com/trade-with-the-big-trend/#comments</comments>
		<pubDate>Mon, 08 Nov 2010 12:18:12 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Strategies]]></category>
		<category><![CDATA[Trend Following]]></category>
		<category><![CDATA[filter]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=3352</guid>
		<description><![CDATA[I was recently asked by a reader how one could go about improving a system by using additional filters to apply to the system signals. Volatility filtering is something that was covered recently; but another &#8220;classic&#8221; filter is based on an extension of the concept of trading with the trend: by considering the higher timeframe [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked by a reader how one could go about improving a system by using additional filters to apply to the system signals. <a href="http://www.automated-trading-system.com/volatility-filters/">Volatility filtering</a> is something that was covered recently; but another &#8220;classic&#8221; filter is based on an extension of the concept of <strong>trading with the trend</strong>: by considering the higher timeframe trend and only taking signals for the system timeframe in the same direction.</p>
<p>For example, trade a 20-50 moving average cross-over system &#8211; but only take long (short) signals if the instrument is in up (down) trend based on the cross-over observed between the longer 50-day and 200-day moving averages (ie bullish when the 50-day MA is above the 200-day MA and bearish when it is below).</p>
<h3>Trade Direction Filter</h3>
<p>This &#8220;trade direction filter&#8221; is something I quickly mentioned in a post covering the <a href="http://www.automated-trading-system.com/e-ratio-trading-edge/">e-ratio calculation</a> to measure the potential edge provided by an entry signal. In that specific example, using such a filter did provide a substantial improvement to a breakout entry signal.</p>
<p>Today, I&#8217;ll revisit this concept by testing it on a system from the <a href="http://www.automated-trading-system.com/state-of-trend-following-october-2010/">State of Trend Following report</a>: the 20-50 MA cross-over system described above.</p>
<p>Below is the comparison between running the system with and without a filter (based on 50/200 MAs cross-over):<span id="more-3352"></span></p>
<table style="border:1px solid #c3c3c3; border-collapse:collapse;">
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;">
      System Stats
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;">
      With Filter
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;">
      W/out Filter
    </th>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
CAGR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">41.27%</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">37.37%</div>
</td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Max DD
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">46.30%</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">53.60%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
MAR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
0.89
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
0.7
    </td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Sharpe Ratio
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
0.87
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
0.54
    </td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
Trade Number
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
2327
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
3629
    </td>
</tr>
</table>
<p>&nbsp;<br />
Based on these performance statistics, the filter seems to be a great improvement to the system&#8230; However, when looking at the equity curves of both systems in a log chart, the picture is not so clear:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/11/Eq-Curves.png" alt="Eq-Curves" title="Eq-Curves" width="447" height="326" class="alignnone size-full wp-image-3360" /></p>
<p>It appears that each version has its period of over/under-performance. I actually ran a quick <a href="http://www.automated-trading-system.com/a-different-application-of-the-bootstrap/"><strong>bootstrap test</strong></a> to evaluate the <strong>significance of the return improvement</strong> for the filtered system and the p-value came out at 0.48 &#8211; so not really of any significance <em>for the return side of things</em>. It would be interesting to measure the p-value for other performance improvements such as drawdown or Sharpe ratio, especially since the improvements are relatively more important there &#8211; I&#8217;ll need to add that to my bootstrap tool.</p>
<p>All thing being equal, the filtering triggers less trades and spends less time in the market, which is a good thing in itself &#8211; especially knowing that for both systems, slippage and commissions were ignored. Factoring these in would mechanically increase the out-performance of the filtered system.</p>
<h3>Only a Delaying Filter</h3>
<p>The interesting characteristic of this sort of filter is that it will not keep the system out of a major trend that might develop: if a trend is strong enough, it will ultimately &#8220;push&#8221; the higher timeframe trend in the same direction as the initial system entry signal.<br />
This only <strong>delays</strong> the entry, as opposed to forcing the system to possibly skip a great trend &#8211; which can sometimes greatly influence the overall performance of the whole system.</p>
<p>Consider the illustration below with the Oil ETF in 2008:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/11/oil-etf.png" alt="Oil ETF" title="Oil ETF" width="442" height="264" class="alignnone size-full wp-image-3355" /></p>
<p>The cross-over between the 20-day MA (green) and the 50-day MA (blue) occurring in July would have been filtered out because of the bullish trend shown by the 50-day MA being above the 200-day MA (red). However, the strength of the trend ultimately &#8220;pushed&#8221; the 50-day MA below the  200-day MA, at which point an entry could have been taken.</p>
<p>This is similar to a concept in the Turtle system where the longer system S2 ensured entry in the case where a trend developed in the longer timeframe and was skipped in the first system S1 (exact rules are described in <a href="http://www.automated-trading-system.com/turtle-trader-covel" target="_blank" rel="nofollow">Covel&#8217;s book</a>).</p>
<h3>A Generic Concept</h3>
<p>Astute readers will have recognised that applying this specific filter to the moving average system is nothing more than reconstructing the triple moving average system (which has this filtering feature built-in). However, the concept is generic and can theoretically be applied with any system and &#8220;big trend&#8221; indicator (eg. price above long MA for a long trend indicator mixed with a Donchian breakout system, etc.). Just some additional elements to play with when testing/building a trading system&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/trade-with-the-big-trend/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Two-Phase vs. Three-Phase Systems</title>
		<link>http://www.automated-trading-system.com/two-phase-vs-three-phase-systems/</link>
		<comments>http://www.automated-trading-system.com/two-phase-vs-three-phase-systems/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 11:12:31 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Strategies]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=3132</guid>
		<description><![CDATA[One of the (many) decisions during the design of trading system is whether the system will be two-phased or three-phased. A two-phase system, also called reversal system, simply has two modes: Long Short It is always in the market, most likely in the direction of the trend. This is fairly simple: it closes the previous [...]]]></description>
			<content:encoded><![CDATA[<p>One of the (many) decisions during the design of trading system is whether the system will be <strong>two-phased or three-phased</strong>.</p>
<p>A <strong>two-phase system</strong>, also called <strong>reversal</strong> system, simply has two modes:</p>
<ul>
<li>Long</li>
<li>Short</li>
</ul>
<p>It is <strong>always in the market</strong>, most likely in the direction of the trend. This is fairly simple: it closes the previous position by opening a new one in the opposite direction. Think of the <em>golden cross</em>-style systems: buy when the short MA crosses up with the long MA and sell when it crosses down.</p>
<p>A <strong>three-phase system</strong> adds a third mode: <em>neutral</em>, where it is not in the market. This usually means that closing a position does not coincide with opening a new one and exits are triggered by a different signal (stop-loss, trailing stop or target profit).<br />
Think of the <a href="http://www.amazon.com/exec/obidos/ASIN/0061241717/autotradblog-20" target="_blank" rel="nofollow">Turtle system</a> for example, which had an initial stop-loss and an exit signal period different from the entry one (20 or 55-day breakout for entry and 10 or 20-day breakout for exit).</p>
<p>Of course, the additional possibility of scaling in and out of a positions blurs the lines between long/neutral and short/neutral in the three-phase system.</p>
<h3>Two v Three: a Comparison</h3>
<p>Both types of systems are widely used and some Wizards do include this information in their prospectus (Dunn uses a two-phase system, JWH a mixture of the two, etc.). <span id="more-3132"></span>Although some managers &#8211; like BlueTrend &#8211; use a &#8220;continuous process&#8221; of adjusting positions, with no discrete entries or exits. The line between long/neutral/short is really blurred in that case.</p>
<p>It is not straight-forward to compare two-phase systems vs. three-phase systems as they usually have different entry/exit signals, which can affect the comparisons. To test, I decided to tinker with a couple of systems from the <a href="http://www.automated-trading-system.com/september-state-of-trend-following-report/">State of Trend Following report</a>:</p>
<ul>
<li>Donchian System </li>
<li>Triple Moving Average</li>
</ul>
<p>These two systems are both three-phase.</p>
<p>The <strong>Donchian system</strong> is a simple breakout system with an entry period (eg 50-day) different from the exit period (typically half that of the entry one, eg 25-day), with an additional entry stop (defined in ATR-multiple for example).</p>
<p>The first modification to the Donchian system was to modify it to a &#8220;two-and-a-half&#8221; phase system by removing the exit signal but leaving the stop-loss: in effect if a trade is not stopped out, it will be reversed when a new opposite entry signal is triggered.</p>
<p>The second modification was to remove the stop altogether  &#8211; making it a real two-phase system.</p>
<p>Below is a comparison between the &#8220;typical&#8221; Donchian system (exit breakout period = half of entry breakout period) and the modified systems described above. I ran these systems over a range of timeframes (different entry breakout periods from 20 days to 200 days) and different position sizing. About 25 combinations of systems were run &#8211; the results are the averages of each system performance stats:</p>
<table style="border:1px solid #c3c3c3; border-collapse:collapse;">
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:3px;">
      Average Stats
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:3px;">
      3-Phase
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:3px;">
      2.5-Phase
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:3px;">
      2-Phase
    </th>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;">
CAGR (%)
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">35.79%</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">38.17%</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">40.33%</div>
</td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;">
Max DD (%)
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">43.64%</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">48.99%</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">52.02%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;">
MAR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.78
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.72
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.77
    </td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;">
Sharpe ratio
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.77
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.86
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.80
    </td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;">
Longest DD
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
23.65
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
26.49
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
26.95
    </td>
</tr>
</table>
<p>&nbsp;<br />
The differences between the results are relatively small and probably not statistically significant. Also note that there might be slight leverage differences as both CAGR and MaxDD increase together over the three different cases.</p>
<p>The <strong>Triple Moving Average</strong> uses three exponential moving averages (long, medium and short). A long (short) entry is triggered when the short MA is above (below) the medium MA, which must be above (below) the long MA. The system I picked also had a condition for the close to be above (below) the short MA. The position is closed when the short MA crosses back with the medium MA. It also has an ATR-based stop-loss.</p>
<p>I modified it by simply transforming it to a two-phase system (by removing any exit signals): an entry simply exits the previous position in the opposite direction. The average stats across a combination of parameters can be found below:</p>
<table style="border:1px solid #c3c3c3; border-collapse:collapse;">
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:3px;">
      Average Stats
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:3px;">
      3-Phase
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:3px;">
      2-Phase
    </th>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;">
CAGR (%)
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">42.60%</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">42.37%</div>
</td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;">
Max DD (%)
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">46.69%</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
<div style="color:black">52.85%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;">
MAR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.88
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.76
    </td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;">
Sharpe ratio
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.69
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:3px;" align = "right">
0.84
    </td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;">
Longest DD
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
17.81
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:3px;" align = "right">
24.96
    </td>
</tr>
</table>
<p>&nbsp;<br />
There are no real obvious conclusions to draw from these examples, just ideas of how to design and modify systems for testing. I suspect every system might react differently to these sort of changes.</p>
<h3>Position sizing and Number of Trades</h3>
<p>An interesting observation though, is that a <strong>smaller position size</strong> is required in the two-phase system to match the performance numbers of the equivalent three-phase system (there is also a dependence on stop levels for the three-phase systems). This could be interesting with regards to the use of margin.</p>
<p>The difference in position size as a percent of equity was non-negligible (factor 2 for the Triple MA system and factor 5 for the Donchian system)</p>
<p>There are also (quite logically) <strong>less trades in the two-phase approach</strong> &#8211; about 30% less for the Donchian system and 50% less for the Triple Moving Average. The simulations above were all executed with slippage set to 0. When adding slippage into the mix, a system trading less frequently <em>should</em> be <strong>less penalized by slippage costs</strong>.<br />
&nbsp;<br />
&nbsp;<br />
Credits: The definition of &#8220;two-phase&#8221; and &#8220;three-phase&#8221; systems can be found on this <a href="http://www.tradingblox.com/forum/viewtopic.php?t=7529" target="_blank">Trading Blox forum thread</a> and on <a href="http://www.jwh.com/templ006.cfm?id=006PD&#038;left=1&#038;tid=006PD" target="_blank">this page from the John W Henry website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/two-phase-vs-three-phase-systems/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Better Trend Following via improved Roll Yield</title>
		<link>http://www.automated-trading-system.com/better-trend-following-improved-roll-yield/</link>
		<comments>http://www.automated-trading-system.com/better-trend-following-improved-roll-yield/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 09:49:22 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Futures]]></category>
		<category><![CDATA[Strategies]]></category>
		<category><![CDATA[Trend Following]]></category>
		<category><![CDATA[DB]]></category>
		<category><![CDATA[roll yield]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=2514</guid>
		<description><![CDATA[To round off a series on backwardation, contango and roll yield (posts 1, 2 and 3), let&#8217;s put all this info together and use it in an innovative trading strategy to show how it can improve the performance of a Trend Following system by optimising its roll yield component (note: this could also be applied [...]]]></description>
			<content:encoded><![CDATA[<p>To round off a series on backwardation, contango and roll yield (posts <a href="http://www.automated-trading-system.com/crude-oil-contango-and-roll-yield-for-commodity-trading/">1</a>, <a href="http://www.automated-trading-system.com/trend-following-returns-breakdown/">2</a> and <a href="http://www.automated-trading-system.com/roll-yield-commodity-yield-curve/">3</a>), let&#8217;s put all this info together and use it in an innovative trading strategy to show how it can improve the performance of a Trend Following system by <strong>optimising its roll yield component</strong> (note: this could also be applied to other systems than Trend Following). The results are pretty interesting.</p>
<h3>DB Optimal Yield Index</h3>
<p>This idea of optimising roll yield is not a brand new approach, however I have never seen it applied to an active trading strategy.</p>
<p>In fact, I have only seen it applied in the <strong>Deutsche Bank Commodity Index</strong> (exact name is a mouthful: <em>Deutsche Bank Liquid Commodity Index &#8211; Optimum Yield Diversified Excess Return</em> &#8211; which I suspect has really only been devised to underlie their <a href="http://dbfunds.db.com/dbc/index.aspx" target="_blank" rel="nofollow">ETF fund</a> tracking it).</p>
<p>Deutsche Bank seems to have taken on-board the fact that <strong>roll yield represents a non-negligible aspect of futures/commodity investing</strong>. From the index/fund website:</p>
<blockquote><p>The Index is a rules-based index composed of futures contracts on 14 of the most heavily-traded and important physical commodities in the world.</p>
<p>Optimum Yield describes the process by which expiring futures contracts in the Index are replaced with new futures contracts. The <strong>Optimum Yield process</strong> seeks to pick the futures contract expiring in the next thirteen months that has the <strong>highest implied roll yield</strong>.</p></blockquote>
<p>In effect, since the fund is <em>always long</em>, it tries to buy the contract which offers the highest rate of <em>backwardation</em>, or at least the lowest rate of <em>contango</em>.</p>
<p>DB do seem to produce some excess return through that process, as displayed by this comparative chart, <em>taken from their marketing material</em>:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/07/DBC_Performance_History1.png" alt="DBC_Performance_History" title="DBC_Performance_History" width="499" height="243" class="alignnone size-full wp-image-2516" /></p>
<h3>Optimal Roll Yield Trend Following</h3>
<p>I wanted to check how a similar concept would perform on an active trading strategy such as a <strong>Trend Following system</strong>. <span id="more-2514"></span>Typically, in mechanical futures trading, one usually uses the front-month contract &#8212; makes it <em>easier to backtest</em> (only one back-adjusted continuous time series to handle) and <em>simpler to trade</em> (only one contract to monitor and trade).</p>
<p>However, in a new <strong>optimal roll yield</strong> approach, for each trading signal to buy or sell, one could have a theoritical choice to trade any available contracts and their associated maturities. For any given date where a trading signal occurs, one could check the futures contracts <strong>yield curve</strong> and determine the <strong>contract which will optimise the roll yield</strong> (highest rate of backwardation, or at least the lowest rate of contango for a BUY signal and the opposite for a SELL signal).</p>
<h3>The Methodology: MA Cross-over 50/20 with Optimal Roll Yield</h3>
<p>The <strong>two components</strong> of Trend Following return we are dealing with here are the returns from the <strong>spot price beta moves</strong> and the <strong>roll yields</strong> from the futures contracts (<a href="http://www.automated-trading-system.com/trend-following-returns-breakdown/">TF returns breakdown here</a>).</p>
<p>The idea is to generate the Trend Following signals based off the spot price movements and for each new signal, compute the yield curve to identify the contract which offers the most attractive roll yield (depending on the signal direction). For this example, I picked a very standard <strong>cross-over system using 50-day and 20-day MAs</strong>.</p>
<p>The process sequence looks like this:</p>
<ol>
<li>Generate the Trend Following strategy signals based off the spot price movements (ie crossovers between the spot price 50-day and 20-day MAs); and for each new signal:</li>
<li>Compute the yield curve to identify the contract which offers the most attractive roll yield (depending on the signal direction).</li>
<li>Buy/Sell that contract</li>
<li>Hold the position until either: 1) the contract expires (roll-over) or 2) the position is reversed (new signal + yield curve computation to pick the best yielding contract)</li>
</ol>
<p>The lookup for the &#8220;best&#8221; contract is limited to <strong>12 months in the future</strong>.</p>
<p>Note that roll-overs should happen less frequently than with a <em>standard</em> approach (because you might buy a contract maturing in 12 months and hold it for the full 12 months &#8211; as opposed to rolling over to the front-month contract every month).</p>
<h3>The Results for Crude Oil</h3>
<p>Because I coded some of the test algorithm outside of Trading Blox (see p.s. below for more details), I decided to keep it simple to start with, and ran the test on one instrument only, keeping working with <strong>Crude Oil</strong> (since it instigated this series on roll yield).</p>
<p>As a reference point, the performance of the 20-50 MA cross-over system on front-month contracts (&#8220;standard&#8221; approach) returned a CAGR of 10.25% with a MaxDD of 46.85% and an annualized Sharpe ratio of 0.37 (no trade costs or slippage included in the test).</p>
<p>OK &#8211; enough introduction, here are the comparison results:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/07/Chart-enhanced-roll-yield.gif" alt="Chart-enhanced-roll-yield" title="Chart-enhanced-roll-yield" width="429" height="335" class="alignnone size-full wp-image-2543" /></p>
<p>The chart shows it pretty clearly and the summary table confirms it:</p>
<table style="border:1px solid #c3c3c3; border-collapse:collapse;">
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;" rowspan=2>
      Statistic
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;" colspan=2>
      Roll Yield approach:
    </th>
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;">
      Standard
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;">
      Optimal
    </th>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
End Balance (start: 10M)
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">73,517,650.00</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black"> 131,778,260.00 </div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
CAGR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">10.26%</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">13.45%</div>
</td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Max Drawdown
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">46.85%</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">28.49%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
Average Drawdown
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
17.38%
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
10.27%
    </td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
MAR Ratio
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.22</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.47</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
Modified Sharpe Ratio*
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.37</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.54</div>
</td>
</tr>
</table>
<p>&nbsp;<br />
The optimal roll yield approach seems to improve the overall system significantly, whatever metrics you wish to pick for comparison. Pretty pleasing results&#8230;</p>
<h3>Volume and Slippage Considerations</h3>
<p>However, there is an important aspect about trading in the front-month only: <strong>liquidity</strong>. And with liquidity come better fills and lower <a href="http://www.automated-trading-system.com/slippage-backtesting-realistic/">slippage &#8212; which can greatly impact trading system results</a>.</p>
<p>My initial assumption was that if the optimal yield concept was viable for a large player like DB to run a fund with, I should not worry about liquidity for a similar approach with Trend Following. By checking the actual volume figures for each contract bought/sold with the strategy, I quickly realised that some trades had been made on days with <em>very low volume</em> (ie <50) and "only" 83% of trades on a daily volume over 1,000. Oops, was I just chasing an elusive unicorn? A theoritical result impossible to to apply in practical real-life trading...</p>
<p>Adding a <strong>liquidity filter</strong> to the roll yield algorithm would allow to reject contracts for which daily volume is too low and avoid liquidity problems. How much would it affect performance, though?</p>
<p>Not too much actually:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/07/LiquidityFilter.png" alt="LiquidityFilter" title="LiquidityFilter" width="511" height="298" class="alignnone size-full wp-image-2545" /></p>
<p>The filter is pretty simple: when it computes the yield curve and checks for the contract with the best roll yield, it only considers contract months for which <strong>daily volume</strong> is <strong>over 5,000</strong>.</p>
<p>And for completeness, the table summarizing the three tests undertaken:</p>
<table style="border:1px solid #c3c3c3; border-collapse:collapse;">
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;" rowspan=2>
      Statistic
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;" colspan=3>
      Roll Yield approach:
    </th>
<tr>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;">
      Standard
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;">
      Optimal
    </th>
<th style="background-color:#e5eecc; border:1px solid #c3c3c3; padding:5px;">
      Optimal w/ Filter
    </th>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
End Balance (start: 10M)
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">73,517,650.00</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black"> 131,778,260.00 </div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">  137,695,690.00 </div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
CAGR
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">10.26%</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">13.45%</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">13.69%</div>
</td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
Max Drawdown
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">46.85%</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">28.49%</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">35.56%</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
Average Drawdown
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
17.38%
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
10.27%
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
12.28%
    </td>
</tr>
<tr>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;">
MAR Ratio
    </td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.22</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.47</div>
</td>
<td style="background-color:#f3f3f3; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.38</div>
</td>
</tr>
<tr>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;">
Modified Sharpe Ratio*
    </td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.37</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.54</div>
</td>
<td style="background-color:#ffffff; border:1px solid #c3c3c3; padding:5px;" align = "right">
<div style="color:black">0.51</div>
</td>
</tr>
</table>
<p>&nbsp;</p>
<p>Note that even with the liquidity filter, slippage <em>might still be</em> a bit better in the front-month contract, as this is where a big chunk of the trading is concentrated. However, real-life testing is the only way to verify and quantify this difference.</p>
<p>To get an idea of how slippage would affect the system performance in general, I ran the standard approach system as a backtest in Trading Blox, with slippage set at a pessimistic 25%. Under these conditions, the system performance (CAGR) dropped &#8220;only&#8221; by 2.5 percentage points.</p>
<h3>Conclusion</h3>
<p>One of my main concerns regarding this strategy was the potential loss in &#8220;raw price moves&#8221; (ie the fact that price trends would not propagate as well in alternative contract months), but the strong correlation between the standard and optimized approach seems to indicate that improved roll yield return does not come at the cost of beta spot price moves return, therefore providing a direct bonus.</p>
<p>It is quite evident that liquidity can become an issue and that a liquidity filter should be employed at a minimum. Moreover Crude Oil, used for this example, is one of the largest traded physical commodity. Other products might not offer enough liquidity depth, far in the yield curve. DB, however, can implement its optimal yield approach over 14 different instruments, which indicates that there is scope for this approach to be employed on additional products to Crude Oil. I believe such approach could have its place in a fully diversified Trend Following system &#8211; but only applied to the most liquid instruments.</p>
<p>Finally the optimal approach <em>might</em> generate some additional slippage compared to the traditional approach. However, this extra slippage cost should still be outweighed by the extra roll yield return, as evidenced in the Trading Blox slippage impact test.</p>
<h3>Epilogue: Techie&#8217;s corner</h3>
<p>In terms of techical implementation, this is slightly more complicated than standard back-testing because each instrument must use multiple price streams (for each individual contract) and cannot be handled by standard back-testing packages (that I know of, or without heavy customisation).</p>
<p>To avoid re-developing a back-testing package from scratch, I used my trusted copy of Trading Blox to generate the &#8220;standard/non-optimal roll yield&#8221; MA cross-over system output for a single instrument (Crude Oil), which output several files providing the dates of the signals as well as other useful computations such as position sizing with number of contracts and running Total Equity values. Using this information, I ran a second pass of processing, by reading the signals and other info generated by Trading Blox, and looping through the individual contract data in order to pick, for each entry signal, the best contract on the yield curve (this second part was coded outside of Trading Blox).</p>
<p>&nbsp;<br />
Credits: Thanks to the Trading Blox forum members to help discuss the subject of this post on <a href="http://www.tradingblox.com/forum/viewtopic.php?p=43060&#038;highlight=optimum+yield#43060" target="_blank">this thread</a>, and especially svquant for pointing out the DB Optimum Yield commodity index.<br />
&nbsp;<br />
&nbsp;<br />
*Note: the Modified Sharpe ratio is as per Jack Schwager&#8217;s definition in <a href="http://www.amazon.com/exec/obidos/ASIN/0471020575/autotradblog-20" target="_blank" rel="nofollow">Managed Futures, Myths and Truths</a>, which introduces interesting performance metrics. The Modified Sharpe ratio is simply a Sharpe ratio where Rf (risk-free rate of return) is set to 0 (makes it independent of leverage). mSR = E[R] / sd.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/better-trend-following-improved-roll-yield/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<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>A trick to reduce Drawdowns</title>
		<link>http://www.automated-trading-system.com/trick-reduce-drawdowns/</link>
		<comments>http://www.automated-trading-system.com/trick-reduce-drawdowns/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 12:00:45 +0000</pubDate>
		<dc:creator>Jez Liberty</dc:creator>
				<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Strategies]]></category>
		<category><![CDATA[Trend Following]]></category>
		<category><![CDATA[drawdown]]></category>
		<category><![CDATA[equity]]></category>
		<category><![CDATA[heat]]></category>

		<guid isPermaLink="false">http://www.automated-trading-system.com/?p=2188</guid>
		<description><![CDATA[Drawdowns represent the scary part of trading system statistics. The drawdown number emphasises the level of loss you might suffer while trading that system. It is risk to your trading capital. Now, for a quick disclaimer: I do not have a magic trick to simply reduce drawdowns&#8230; but with this cheeky title, I wanted to [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_2190" class="wp-caption alignleft" style="width: 310px"><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/04/buddhabrot_jared-300x300.jpg" alt="Illustration by jared@flickr" title="buddhabrot_jared" width="300" height="300" class="size-medium wp-image-2190" /><p class="wp-caption-text">Illustration by jared@flickr</p></div>
<p>Drawdowns represent the <em>scary</em> part of trading system statistics. The drawdown number emphasises the level of loss you might suffer while trading that system. It is <em>risk</em> to your trading capital.</p>
<p>Now, for a <strong>quick disclaimer</strong>: I do not have a <em>magic trick</em> to simply reduce drawdowns&#8230; but with this cheeky title, I wanted to draw your attention to how you can interpret drawdowns with more nuance. We&#8217;ll still reduce the drawdwon of a system, but with no magic trick involved.</p>
<p>Obviously, you know that drawdown is the relative distance between the current equity and the highest past equity peak. And when considering using a system with a Max Drawdown of 30%, this is the amount potentially threatening your starting trading capital. Well, not necessarily so&#8230;</p>
<p>It all depends what you consider your <em>capital</em> and <strong>what equity you use to measure your drawdown</strong>. <span id="more-2188"></span>Total equity is the universal measure in terms of reporting (including drawdown figures). It is made up of both <em>closed and open</em> equities. Closed equity is your account balance after taking into account the starting balance and all closed trades. Open equity is the value of all open positions.</p>
<h3>Trend Following induces Drawdowns</h3>
<p>By nature, <strong>Trend Following is a strategy prone to drawdowns</strong> because of the way it waits for the trend to reverse before closing the position. On any winning Trend Following trade, there is often a lot of open equity &#8220;given back&#8221; to the market.</p>
<p>Below is an equity graph of the life of a hypothetical Trend Following trade:</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/04/EquityCurves.png" alt="EquityCurves" title="EquityCurves" width="455" height="297" class="alignnone size-full wp-image-2191" /></p>
<p>The closed equity only changes when the trade is closed out, while the total equity reflects the value of the open position (open equity) added to the closed equity. The non-risk equity represents that portion of equity if the trade hit its stop-loss and was closed out, effectively representing the locked-in equity from the trade. As we enter the trade, the locked-in equity is negative (stop-loss below trade entry price) but as we gradually raise the stop-loss level (or as the indicator used for the exit signal moves up) the locked-in equity becomes positive. When the trade ends, the three equity curves meet again.</p>
<h3>Does it make sense to look at Total/Open Equity?</h3>
<p>As mentioned earlier, total equity is the universal measure of system performance. You often hear that you should consider the value of open profits (open equity) in the same way as your hard-earned capital and defend it just the same (rather than gambling it away as if it was the <em>market&#8217;s money</em>). I do not believe this directly applies to Trend Following, which does not attempt to time tops and bottoms; and enters trades with the understanding that a large portion of each trade open profit will be left &#8220;on the table&#8221;, but that, on the long run, is the best way to benefit from these trends.</p>
<p>Trend Following&#8217;s open profit (open equity) is just potential profit &#8211; and as the saying goes:</p>
<blockquote><p>Don&#8217;t count your chicken before they hatch.</p></blockquote>
<p>It might be cautious to do the same thing with your trading system, and not bank on the open equity, or treat it the same way as actual, realized profits.</p>
<p>Looking at the hypothetical trade example and its associated equity curves, it might not make the most sense to look at your system&#8217;s performance through the green total equity curve &#8220;lens&#8221;. It is arguable whether the open equity and its highest point have much direct relevance to the system result if we accept that letting the open equity grow and subsequently shrink is &#8220;part of the game&#8221;. The open equity does not directly affect the bottom line.</p>
<p>What matters is how much of our capital (closed equity) we risk, and how much profit is actually made.</p>
<h3>Total Equity and System Statistics</h3>
<p>On the equity curves chart, representing only one winning trade, the relatively wide variations in open equity impact some system statistics:</p>
<p>Despite the fact that the trade never loses more than half the initial risk, it leaves us with a <strong>drawdown</strong> of three times the initial risk percentage.</p>
<p>Also, of interest, to monitor the risk taken, is the <strong>system heat</strong>. The typical heat calculation is the amount of equity at risk, basically the difference between the total equity and the non-risk equity. Every time we open a new trade, the heat is equal to the initial risk taken for that trade (ie. based on the position size). However, as the trade progresses, the heat increases to multiples of that amount, despite the real initial risk being unchanged.</p>
<p>Looking at raw drawdown and heat numbers from a total equity point of view would give a false impression of the actual dynamics of the system, which seems penalized for what is, in essence, a good Trend Following trade.</p>
<p>It could be argued (and I do) that looking at alternative equity curves might give a clearer picture.</p>
<p>In terms of drawdowns, we know that a large portion of the drawdown is actually due to giving back open profits, a necessary &#8220;evil&#8221; to implement a Trend Following strategy. <strong>Drawdown on closed equity</strong> is a better measure of how the system is going wrong by actually taking losing trades, and of how much capital might really be lost when trading the system.</p>
<p>Similarly, for the risk currently taken by the system, you might want to measure the heat by comparing closed equity to non-risk equity. The heat being the difference between the former and the latter (ie equal to the opposite of the locked-in equity when negative, zero when positive).</p>
<p>On the winning trade example, this would give drastically reduced drawdown and risk/heat figures.</p>
<h3>Real System Drawdown Reduction</h3>
<p>This is all well and good in a single theoritical trade example, but how does this actually affect a real system? To check this, I fired up <a href="http://www.automated-trading-system.com/trading-blox-teaser-review/">Trading Blox</a> and ran a standard Donchian system (50-day breakout) and calculated MaxDD on both total and closed equity curves. First, here is the chart of both curves. As expected they roughly follow the same path, spreading apart and joining again regularly &#8211; but they never diverge for too long (and never will):</p>
<p><img src="http://www.automated-trading-system.com/wp-content/uploads/2010/04/TotalvClosedEquity.png" alt="TotalvClosedEquity" title="TotalvClosedEquity" width="499" height="370" class="alignnone size-full wp-image-2192" /></p>
<p>The curves do look similar, however the drawdown figures are quite different, with the Total Equity Drawdown being nearly 35% larger than the Closed Equity one:</p>
<ul>
<li>Total Equity Max Drawdown: 38.2%</li>
<li>Closed Equity Max Drawdown: 28.5%</li>
</ul>
<p>Would you have started trading this system at any time in the past, you could not have incurred a loss to your starting capital of more than 28.5%, despite the headline drawdown figure of 38.2% (note: I am assuming that when starting trading a system, one only takes new signals).</p>
<h3>In Closing</h3>
<p>I am sure this is a controversial point of view amongst trading system designers and total equity is necessarily the one to look at for accounting, tax and fund reporting reasons.</p>
<p>This post is not really advocating one way of measuring system performance over another but draws the attention to interpreting the right statistic for the right characteristic, when designing and monitoring your trading system. Now, it also depends whether you are designing a system for yourself or for potential investors&#8230;</p>
<p>PS: in place of &#8220;non-risk equity&#8221;, used in this post, you might also come across the term&#8221;core equity&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.automated-trading-system.com/trick-reduce-drawdowns/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

