<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Milktrader</title>
	<atom:link href="http://milktrader.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://milktrader.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 11 Nov 2009 17:00:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='milktrader.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Milktrader</title>
		<link>http://milktrader.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://milktrader.wordpress.com/osd.xml" title="Milktrader" />
	<atom:link rel='hub' href='http://milktrader.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Evaluating the Fitness of a Fitness Function</title>
		<link>http://milktrader.wordpress.com/2009/11/09/evaluating-the-fitness-of-a-fitness-function-2/</link>
		<comments>http://milktrader.wordpress.com/2009/11/09/evaluating-the-fitness-of-a-fitness-function-2/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 03:26:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[System Trading Nuts and Bolts]]></category>
		<category><![CDATA[Fitness Function]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/11/09/evaluating-the-fitness-of-a-fitness-function-2</guid>
		<description><![CDATA[The walk-forward process of system development is the final test of a system before real capital gets allocated. It validates the system on out-sample data, or data that hasn&#8217;t been peeked at during development. It&#8217;s not very complicated, really. You optimize your system on a range of data and then choose the best parameter set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=76&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The walk-forward process of system development is the final test of a system before real capital gets allocated. It validates the system on out-sample data, or data that hasn&#8217;t been peeked at during development. It&#8217;s not very complicated, really. You optimize your system on a range of data and then choose the best parameter set to trade with in the out-sample period. Then you observe the results and determine if the system warrants any capital investment. As with most things in system trading, you need to make a decision on how you approach this idea of picking the best parameter set. Who or what decides what is <span style="font-style:italic;">best</span>? The arbiter is known as a fitness function, because it determines which parameter set is best suited for future trading. Not all fitness functions are created equal though. Let&#8217;s look at three fitness functions and see how they offer different results. <span id="more-76"></span><span class="fullpost"> </span></p>
<p>I&#8217;m using data derived from a walk-forward of the White Bumblebee system and the DX future contract (US Dollar). The out-sample data is over 10 years in length, and the total number of walk-forward periods comes to 10, as I&#8217;ve optimized on 400 days and traded on 200 days. The different fitness functions include Net Profit, Net Profit/Drawdown, and Pessimistic Return on Margin (PROM). For Net Profit, the system returns the parameter set that had the highest Net Profit during the optimization period and then uses those settings for the trading window. Same logic for the other fitness functions.</p>
<p>I&#8217;ve broken down the analysis into two sections: Profit Metrics, and Drawdown Metrics. In each category, I&#8217;m interested in the total, range, max, min, mean and standard deviation. My backtesting software is TradersStudio and the statistical software that paints the graphs is R.</p>
<p>First let&#8217;s look at the Profit Metrics.<br />
<a href="http://milktrader.files.wordpress.com/2009/11/profitmetrics.gif"><img src="http://milktrader.files.wordpress.com/2009/11/profitmetrics.gif?w=300" border="0" alt="" /></a></p>
<p>In the end, all three produced about the same total profit over 10 years. Net Profit registered the largest profit during a single period, but also the highest range. All three fitness functions had losing periods, but it is interesting to note that the Net Profit/Drawdown function had the least worst period, or it lost small when it lost.</p>
<p>Next, let&#8217;s look at the Drawdown Metrics.</p>
<p><a href="http://milktrader.files.wordpress.com/2009/11/ddmetrics.gif"><img src="http://milktrader.files.wordpress.com/2009/11/ddmetrics.gif?w=300" border="0" alt="" /></a></p>
<p>Here again, the Net Profit/DD fitness function yields the most attractive results. It experienced the least drawdown in a period and also the least amount of total drawdown during the 10-year testing period.</p>
<p>Keep in mind that the sample size is fairly small here with only 10 walk-forward periods being analyzed. You could easily argue that these results are not statistically valid, but at least it points out that all fitness functions are not created equal. Finding the best one may require some time and brain cells on the system trader&#8217;s part, but hopefully well-spent.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=76&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/11/09/evaluating-the-fitness-of-a-fitness-function-2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>

		<media:content url="http://milktrader.files.wordpress.com/2009/11/profitmetrics.gif?w=300" medium="image" />

		<media:content url="http://milktrader.files.wordpress.com/2009/11/ddmetrics.gif?w=300" medium="image" />
	</item>
		<item>
		<title>A Short List of Candidates</title>
		<link>http://milktrader.wordpress.com/2009/11/06/a-short-list-of-candidates/</link>
		<comments>http://milktrader.wordpress.com/2009/11/06/a-short-list-of-candidates/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 01:54:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[System Trading Nuts and Bolts]]></category>
		<category><![CDATA[Futures]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/11/06/a-short-list-of-candidates</guid>
		<description><![CDATA[You can&#8217;t trade everything. Well, at least you can&#8217;t trade everything well. At some point, you should limit the universe of things you trade. And it&#8217;s okay. You don&#8217;t need to trade everything because quite frankly, nobody knows what you&#8217;re talking about anyway at the weekend cocktail party, and they don&#8217;t care. I implore you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=75&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You can&#8217;t trade everything. Well, at least you can&#8217;t trade everything well. At some point, you should limit the universe of things you trade. And it&#8217;s okay. You don&#8217;t need to trade everything because quite frankly, nobody knows what you&#8217;re talking about anyway at the weekend cocktail party, and they don&#8217;t care. I implore you to be prudent in this way: commit to trading a specific world of underlyings, and quit chasing bright lights in the depths of the ocean, like everyone&#8217;s favorite Nemo character, Dory the Blue Tang. <span id="more-75"></span></p>
<p>It can be anything such as large cap stocks, penny stocks, major currency pairs, or just one stock or currency pair. Or just the ES futures. Or you can make the case of trading what is cool and in vogue, such as GOOG into earnings, or gold stocks when everyone is buzzing about gold. I&#8217;ve chosen to trade the universe of liquid futures. And I&#8217;ve wittled down the list of qualifying candidates to just fifty-two.</p>
<p>My list is crafted carefully around major market groups, which have a tendency to inter-relate and correlate. The basic groups include:</p>
<p>1. Currencies (7)<br />
2. Interest Rates (10)<br />
3. Equities (9)<br />
4. Metals (5)<br />
5. Energy (4)<br />
6. Commodities (17)</p>
<p><span style="font-weight:bold;">Currencies:</span></p>
<p>This group includes the Dollar, Euro, Pound, Yen, Aussie, Swiss Franc and Canadian Dollar. Pretty much the major currencies with the Aussie and Canadian related to commodities.</p>
<p><span style="font-weight:bold;">Interest Rates:</span></p>
<p>This groups consists of US Treasuries (2-year, 5-year, 10-year, 30-year), the Eurodollar and foreign treasuries that include the Canadian 10-year, the Gilt Long Bond (British debt), and the German debt complex of Eurobund (10-year), Euro BOBL (5-year) and Euro Shatz (2-year). Potential inter-market relationships between these markets and both the currency and equity markets abound.<br />
<span style="font-weight:bold;"><br />
Equities:</span></p>
<p>Okay, the standard US equity markets need to be included. I&#8217;ve chosen to leave out the DOW futures and focus on the S&amp;P 500, Nasdaq 100 and the Russell 2000. For international exposure I&#8217;ve included the Nikkei (Japan), CAC 40 (France), Euro STOXX 50 (Europe), FTSE 100 (Britain), DAX 30(Germany) and the Heng Seng (Hong Kong).<br />
<span style="font-weight:bold;"><br />
Metals:</span></p>
<p>You can&#8217;t leave out gold or silver. Their ratio is actually an important metric. I&#8217;ve also included other precious metals such as platinum and palladium (think catalytic converters and cell phones), and the base metal of copper.</p>
<p><span style="font-weight:bold;">Energy:</span></p>
<p>Of course we include crude oil and natural gas. Also included are refined products such as heating oil and gasoline.<br />
<span style="font-weight:bold;"><br />
Commodities:</span></p>
<p>This is the largest group, so let&#8217;s divide it up into Grains, Livestock, Forest and Softs (I&#8217;m following the CME Group convention here).</p>
<p>Grains include corn, wheat, soybean, soybean oil, soybean meal, oats and rough rice.</p>
<p>Livestock includes live cattle, lean hogs, feeder cattle and everyone&#8217;s favorite future &#8211; pork bellies.</p>
<p>Forest includes lumber.</p>
<p>Softs include cocoa, coffee, cotton, sugar and orange juice.</p>
<p>And that&#8217;s it.</p>
<p>Just 52 underlyings, many of which have interesting inter-market relationships.</p>
<p>This is my final roster of players, and they will all participate in future backtesting regimes. Will I trade them all? No. Money management may limit the total number of underlyings to a small percentage of the universe, but those 5-7 futures will represent a good diversification of product, and will also be the best representative for a particular trading strategy.</p>
<p>Dory got confused once in Finding Nemo and said: &#8216;I don&#8217;t know where I am&#8230; I don&#8217;t know what&#8217;s going on. I think I lost somebody but I, I can&#8217;t remember.&#8217; Don&#8217;t be that fish.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=75&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/11/06/a-short-list-of-candidates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>
	</item>
		<item>
		<title>Long R, Short Excel</title>
		<link>http://milktrader.wordpress.com/2009/10/29/long-r-short-excel/</link>
		<comments>http://milktrader.wordpress.com/2009/10/29/long-r-short-excel/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 23:59:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[Programming and Software]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/10/29/long-r-short-excel</guid>
		<description><![CDATA[R is very speedy statistical package that&#8217;s like an F-18A Hornet, versus Excel which is like a paper airplane. R is professional sports, Excel is Pop Warner. R is Mona Lisa, Excel is stick figures. R is &#8230; okay, you get the idea. I&#8217;m long R, and short Excel. For traders that are analyzing vasts [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=74&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>R is very speedy statistical package that&#8217;s like an F-18A Hornet, versus Excel which is like a paper airplane. R is professional sports, Excel is Pop Warner. R is Mona Lisa, Excel is stick figures. R is &#8230; okay, you get the idea. I&#8217;m long R, and short Excel. For traders that are analyzing vasts amount of data, it&#8217;s time you made the switch to the trader&#8217;s statistical package of choice. You have to work a little at understanding the scripting language, but it&#8217;s nothing that you can&#8217;t wrap your mind around in a few nights after the kids go to bed. I&#8217;m just getting acquainted with R, and I&#8217;m already putting my copy of Excel on eBay.<span id="more-74"></span></p>
<p><span style="font-weight:bold;">Cut-and-paste versus read-in:</span></p>
<p>After you&#8217;ve generated vast amounts of data from an optimization run, you find yourself with the loathsome task of cutting and pasting the data into an Excel spreadsheet that you&#8217;ve probably already pre-formatted to look at the data. It requires you to select the data and not miss any rows, and it opens up the possibility that something gets left out. With R, you don&#8217;t touch it once you&#8217;ve converted it to a .csv file. You simply reference it in your script.</p>
<p><span style="font-weight:bold;">Manipulating columns of data:</span></p>
<p>In Excel, you know the drill. Select a cell to compute the mean of a row and then select the elements of a column that you&#8217;d like to apply the formula to. When you have over 1,000 rows, it takes a while to drag that stupid mouse. Just as you approach the end of your values, the cursor goes wild and runs down to infinity. Ugh. Well, with R that is no longer an issue since you define the column of data (called a vector) to a script that quickly returns the value you&#8217;re looking for.</p>
<p><span style="font-weight:bold;">Add-in packages:</span></p>
<p>Remember how excited you were to install the Data Analysis pack in Excel and how it gave summary statistics for a column of data that included mean, standard deviation and other stuff you had no idea what they were? Well, that&#8217;s a standard part of R. And as you graduate from Statistics 101, you&#8217;ll find that there are add-in packages in R that range from neural networks to Bayesian statistics, from genetic algorithms to copulas (side note: the geniuses who created tranched derivatives that came home to roost last year used gaussian copulas, amongst other things).</p>
<p><span style="font-weight:bold;">Cost:</span></p>
<p>I think I paid in the neighborhood of $250 for my copy of Excel. I paid nothing for R, since it is open-source and free.<br />
<span style="font-weight:bold;"><br />
The issue of crashing Windows:</span></p>
<p>I have crashed my computer by asking Excel to compute too much data. So far, R hasn&#8217;t produced the same results. And based on its architecture, I&#8217;m not expecting it.</p>
<p><span style="font-weight:bold;">Graphs and dynamic data:</span></p>
<p>If you want to create a chart or graph of something in Excel, you need to navigate through that stupid menu of crazy pictures to get something that&#8217;s clunky and difficult to maintain. In R, you use scripts to create charts and graphs, and the data file feeding the chart is dynamic so that each time data is added, R will incorporate the new data. No offsetting shenanigans.</p>
<p>There are video tutorials available at the usual places you&#8217;d find that sort of thing, and a very robust community of R users to help get you started. So put down your toys and get to work. There is much data that needs analyzing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=74&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/10/29/long-r-short-excel/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>
	</item>
		<item>
		<title>System Trading is Quicksand without the Quick</title>
		<link>http://milktrader.wordpress.com/2009/10/28/system-trading-is-quicksand-without-the-quick/</link>
		<comments>http://milktrader.wordpress.com/2009/10/28/system-trading-is-quicksand-without-the-quick/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 14:19:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[System Trading Nuts and Bolts]]></category>
		<category><![CDATA[Psychology]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/10/28/system-trading-is-quicksand-without-the-quick</guid>
		<description><![CDATA[Perhaps the best way to describe the path to system trading is slogging. It&#8217;s like one of those dreams where you&#8217;re trying to run in the sand, and it keeps sinking. And then it starts to rain and the wind starts blowing you backwards. Like many things related to trading, system trading sounds simple on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=73&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Perhaps the best way to describe the path to system trading is <span style="font-style:italic;">slogging</span>. It&#8217;s like one of those dreams where you&#8217;re trying to run in the sand, and it keeps sinking. And then it starts to rain and the wind starts blowing you backwards. Like many things related to trading, system trading sounds simple on its face, but becomes increasingly elusive as one pursues it. <span id="more-73"></span><span class="fullpost"> </span></p>
<p>System trading distinguishes itself from other forms of trading in that it has a high threshold for capital allocations. Feelings, notions, guru tips and gut instinct are not sufficient for the system trader. There needs to be a formalized approach to the trade that can be back-tested on historical data. This first step is not all that involved, really. There are many off-the-shelf programs that can perform a back-test of a trading system. But once you get the results, what do you do with it?</p>
<p>You ponder, perhaps, and cast a skeptical eye upon promising results. You start wondering (and rightfully so) whether past performance has any correlation with future returns. Well, how would you know? At this point you can either sell the program to others or try it out yourself.</p>
<p>A way to test the back-test is to perform an optimization. This is running the back-test with different parameters (ie, moving averages with varying length for an MA crossover system). If it performs well under this process, you can gain some more confidence in your system. But how would one define &#8216;performs well&#8217;? There are many metrics to look at including net profit, drawdown and ratios of those two. How many permutations were profitable as a percentage of all the permutations that were run? What percentage of permutations had a net profit that exceeded maximum drawdown? Is that a good number? What is the best parameter set? What was the measuring stick used to determine the winning set? Now we see where the quagmire begins.</p>
<p>You are now the proud owner of stacks of statistics that you need to sort out. It&#8217;s like going through your coupon drawer. You know, the one that has mostly expired coupons, and some for junk you wouldn&#8217;t buy if it were free. The optimization results are not a self-evident validation or rejection of a trade system. It takes a thinking person to evaluate what they&#8217;ve got.</p>
<p>And after this is sorted out, there is still another step of testing the system on out-of-sample data. Why? Well, because your optimization process found good parameters, but it fit the data to do it. The process is called curve-fitting in statistics and involves making things fit. Not necessarily bad, but it can be overdone. That&#8217;s why we walk-forward, or test on out-of-sample data. It&#8217;s the same thing as trading the system in real-time. After this process is complete, you find yourself with another truckload of disorganized coupons.</p>
<p>Besides the programming skills needed to do the basics, you need a decent grasp of statistics, good organization skills (where did I put that file on the Coffee market between 1998 and 1990?), and the basic understanding of how markets work. Understanding markets is crucial, as many nerdy statisticians with excellent programming skills have proven by losing large sums of money. Don&#8217;t be afraid of having to learn a lot of stuff, though. Trading is not for the lazy.</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=73&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/10/28/system-trading-is-quicksand-without-the-quick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>
	</item>
		<item>
		<title>Is your equity curve underwater this year?</title>
		<link>http://milktrader.wordpress.com/2009/10/09/is-your-equity-curve-underwater-this-year/</link>
		<comments>http://milktrader.wordpress.com/2009/10/09/is-your-equity-curve-underwater-this-year/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 02:50:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[Pavel Stratan]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/10/09/is-your-equity-curve-underwater-this-year</guid>
		<description><![CDATA[Is your equity curve underwater so far this year? Okay, you may be a loser, but you can still sing a very fine tune. It&#8217;s not the same as singing joyfully and proudly about your ability to follow a trend, but it&#8217;s close.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=72&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Is your equity curve underwater so far this year? Okay, you may be a loser, but you can still sing a very fine tune. It&#8217;s not the same as singing joyfully and proudly about your ability to follow a trend, but it&#8217;s close. </p>
<span style="text-align:center; display: block;"><a href="http://milktrader.wordpress.com/2009/10/09/is-your-equity-curve-underwater-this-year/"><img src="http://img.youtube.com/vi/jsxpL-XWEww/2.jpg" alt="" /></a></span>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/72/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/72/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/72/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=72&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/10/09/is-your-equity-curve-underwater-this-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>
	</item>
		<item>
		<title>Are you related to Perfect Profit?</title>
		<link>http://milktrader.wordpress.com/2009/10/09/are-you-related-to-perfect-profit/</link>
		<comments>http://milktrader.wordpress.com/2009/10/09/are-you-related-to-perfect-profit/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 00:22:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[System Trading Nuts and Bolts]]></category>
		<category><![CDATA[Equity Curve]]></category>
		<category><![CDATA[Perfect Profit]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/10/09/are-you-related-to-perfect-profit</guid>
		<description><![CDATA[Okay, by now you&#8217;ve probably discovered you are not the perfect trader. You are but a fraction (if that) of the money-banking machine. He is no longer your friend, this creature known as Perfect Profit is your competition. Now that you&#8217;ve formally met your competition, what is the family resemblance between your equity curve and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=71&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Okay, by now you&#8217;ve probably discovered you are not the perfect trader. You are but a fraction (if that) of the money-banking machine. He is no longer your friend, this creature known as Perfect Profit is your competition. Now that you&#8217;ve formally met your competition, what is the family resemblance between your equity curve and Perfect Profit&#8217;s equity curve? Are you brother and sister, second cousins or do you need to go all the way back to Tiktaalik roseae to find a common gene? On the practical level, what is the correlation between your equity curve and Perfect Profit&#8217;s equity curve?<span id="more-71"></span></p>
<p>The formula for correlation is actually quite simple. I could derive it for you, but this is not high-school statistics, so I&#8217;ll just show it below:</p>
<p><a href="http://milktrader.files.wordpress.com/2009/10/correlationequation.gif"><img src="http://milktrader.files.wordpress.com/2009/10/correlationequation.gif?w=296" border="0" alt="" /></a></p>
<p>It&#8217;s the best depiction I found on the Internet. Look at the bottom part of the equation and just substitute that gobblygook with standard deviation of X and standard deviation of Y and you have a much cleaner looking equation.</p>
<p>Oh, yawn. Where&#8217;s the stock tip? I need to know what stock I need to buy tomorrow so please, stop with the algebra already.</p>
<p>These highly trending equity markets will not sustain themselves indefinitely, and you need to start thinking about the range-bound scenario that may happen in the next couple years. For that you need a system. And I offer you a metric now to compare your system&#8217;s equity curve with Perfect Profit&#8217;s equity curve.</p>
<p>What does a high correlation indicate? Well, that you are extracting profits (albeit at a slower pace than Perfect) in-line with what your competition is doing.</p>
<p>What does low correlation indicate? Your system is not achieving its destined returns based on what the market offers.</p>
<p>If your system has low correlation with your ultimate competitor, Perfect Profit, then you probably are just lucky right now. There is nothing wrong with being lucky and being rich, but consider your fortune as a potential predicament.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=71&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/10/09/are-you-related-to-perfect-profit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>

		<media:content url="http://milktrader.files.wordpress.com/2009/10/correlationequation.gif?w=296" medium="image" />
	</item>
		<item>
		<title>How close are you to perfect?</title>
		<link>http://milktrader.wordpress.com/2009/10/08/how-close-are-you-to-perfect/</link>
		<comments>http://milktrader.wordpress.com/2009/10/08/how-close-are-you-to-perfect/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 02:32:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[System Trading Nuts and Bolts]]></category>
		<category><![CDATA[Equity Curve]]></category>
		<category><![CDATA[Perfect Profit]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/10/08/how-close-are-you-to-perfect</guid>
		<description><![CDATA[Becoming the perfect trader is no easy task, and I daresay that nobody has been able to achieve this great feat. The perfect trader buys at the absolute low of the day and sells at the absolute high. And depending on whether the high happens first or the low happens first determines if he is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=70&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Becoming the perfect trader is no easy task, and I daresay that nobody has been able to achieve this great feat. The perfect trader buys at the absolute low of the day and sells at the absolute high. And depending on whether the high happens first or the low happens first determines if he is long or short for the day. It&#8217;s really easy to calculate this metric. It is simply the absolute value of the daily range or the high minus the low.<span id="more-70"></span></p>
<p>To get an accurate handle on the concept, we first ask what time frame we will be using. For end-of-day traders or swing traders, the daily bar is your competition. If you day-trade off the five-minute bar, well then use the five-minute bar to gauge your performance.</p>
<p>This concept is used in system trading and because vast amounts of data are typically used, we system traders need to resort to our super-duper calculators, also referred to as our programming language. This is an example of what code looks like for our daily perfect trader. The language is TradersStudio&#8217;s version of Visual Basic, but you can get the idea and use it with any program you wish. It&#8217;s the basic loop function.</p>
<p style="text-align:left;"><em>For i = FirstBar to LastBar step 1</em></p>
<p style="text-align:left;"><em>Next</em></p>
<p style="text-align:left;"><em>PerfectProfit = PerfectProfit + Range [i]</em></p>
<p>You&#8217;ll need to dimension your PerfectProfit variable as an array if you want it to tally up daily ranges.</p>
<p>But you don&#8217;t need to be a systems trader to get some use from the concept. You can simply take a sheet of paper and tally the sum of all the bar ranges for your time frame. Take your net profit and divide it by perfect profit for a sobering assessment of how far from perfect you really are.</p>
<p>If you are 20% of perfect, then you have an impressive system. Don&#8217;t be discouraged to find out you&#8217;re more in the 2% range. What they say about flyfishing applies. First you try to catch a fish (profitable trade), then you try to catch a lot of fish (consistently profitable), then you try to catch big fish (participating in large moves) and then you seek the fish that has never yet been caught.</p>
<p>Good luck fishing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=70&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/10/08/how-close-are-you-to-perfect/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>
	</item>
		<item>
		<title>Rusty Apple</title>
		<link>http://milktrader.wordpress.com/2009/10/02/rusty-apple/</link>
		<comments>http://milktrader.wordpress.com/2009/10/02/rusty-apple/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 01:03:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[System Trading Musings]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/10/02/rusty-apple</guid>
		<description><![CDATA[The main objective of system trading is to create a trade system that has predictive value and can make money for years to come. If a system historically doesn&#8217;t make money, it&#8217;s not worth pursuing. Or is it? In the curious world of trade system development, some have stumbled upon good trading systems by fading [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=69&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The main objective of system trading is to create a trade system that has predictive value and can make money for years to come. If a system historically doesn&#8217;t make money, it&#8217;s not worth pursuing. Or is it? In the curious world of trade system development, some have stumbled upon good trading systems by fading their original idea, which performed so abysmally that you couldn&#8217;t lose that much money unless you started throwing it out the window as fast as you can. System trading can also provide other insights into market behavior that, if not yielding a tradeable system, can at least give you some ideas about developing one. From the twitter world, I got the following idea from AshRust: How about each time the VIX spikes X% buy AAPL, then sell after 5/15/30 days w/ 10% stop loss? It&#8217;s an interesting idea that&#8217;s contrarian and uses intermarket analysis to trigger a long trade. Does it work? Can you trade it? Or is it nothing more than a curious data-mined notion?<span id="more-69"></span></p>
<p>My first impression is that it&#8217;s not an idea one would actually trade real money with. But is it an interesting factoid? Well, to pursue the idea, I quickly coded the idea (I use TradersStudio) with three parameters that include VIX Spike, N Days to Hold and Percent Stop Loss. Preliminary research showed that fine-tuning a stop loss percentage was not all that meaningful, so I focused on varying only the amount of VIX spike that would trigger the trade, and the number of days to hold the long Apple stock. Since I&#8217;m not developing this idea as a trade system, I did not protect any data from the perils of optimization&#8217;s curve-fitting process. I didn&#8217;t even really backtest the idea since I&#8217;m not sure what parameter sets would make sense but instead ran straight into optimization. The period is from October 1, 1999 to October 1, 2009 (10 years). I stepped the N days to hold from 2 to 30 days in chunks of 2 days, and the VIX spike from 2% to 20% in chunks of 1%. That&#8217;s 285 permutations that yields the following space with respect to profitability (above zero line is profitable):</p>
<p><a href="http://milktrader.files.wordpress.com/2009/10/rustyappleunfiltered.gif"><img src="http://milktrader.files.wordpress.com/2009/10/rustyappleunfiltered.gif?w=300" border="0" alt="" /></a></p>
<p>Of all the permutations, 41% were profitable. Hmmm, maybe we can improve on the idea. What if no trades were taken when there was a positive correlation between AAPL and VIX? After all, it is a contrarian trade idea. Well, a little line in the code does the trick and the following optimization space is the result:</p>
<p><a href="http://milktrader.files.wordpress.com/2009/10/rustyapplewithcorrelationfilter.gif"><img src="http://milktrader.files.wordpress.com/2009/10/rustyapplewithcorrelationfilter.gif?w=300" border="0" alt="" /></a></p>
<p>It yields less trades with the filter (obviously) but there is also a decrease in the percentage of profitable parameter sets with the total coming to 36%. Oh well, at least now we know. Anyone who made money using this system over the past ten years did so on the basis of pure luck. If , however, you have a time machine that can go back to 1999, I suggest you buy APPL whenever the VIX spikes at least 4% and hold the long stock for 2 days. You will have been a genius and could brag about an annualized return of 47% over ten years.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/69/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/69/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/69/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=69&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/10/02/rusty-apple/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>

		<media:content url="http://milktrader.files.wordpress.com/2009/10/rustyappleunfiltered.gif?w=300" medium="image" />

		<media:content url="http://milktrader.files.wordpress.com/2009/10/rustyapplewithcorrelationfilter.gif?w=300" medium="image" />
	</item>
		<item>
		<title>Goodbye Bumblebee, Hello Ladybug</title>
		<link>http://milktrader.wordpress.com/2009/09/25/goodbye-bumblebee-hello-ladybug/</link>
		<comments>http://milktrader.wordpress.com/2009/09/25/goodbye-bumblebee-hello-ladybug/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 00:49:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[Bumblebee]]></category>
		<category><![CDATA[Ladybug]]></category>
		<category><![CDATA[Backtest]]></category>
		<category><![CDATA[Optimization]]></category>
		<category><![CDATA[Walk Forward]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/09/25/goodbye-bumblebee-hello-ladybug</guid>
		<description><![CDATA[I had grand schemes and lofty goals for the Bumblebee system. But barring an egregious mistake in my walk-forward of the system, I have to let the critter go. The White Bumblebee (first version) suffered massively in its synthetic real-world experience, like a patient etherised on the table only to suffer reality&#8217;s cruel but necessary [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=68&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had grand schemes and lofty goals for the Bumblebee system. But barring an egregious mistake in my walk-forward of the system, I have to let the critter go. The White Bumblebee (first version) suffered massively in its synthetic real-world experience, like a patient etherised on the table only to suffer reality&#8217;s cruel but necessary knife. I had other versions queued up and ready to improve upon the simplest version, but they did no better in their walk-forwards. Not to worry, there are many more insects in the hopper. Next one sprawling on a pin is the Ladybug. It is based on Keltner band breakouts. Keltner bands are like Bollinger bands, but they&#8217;re based on ATR instead of standard deviation. The basic idea is that once the band is breached, take a trade in the direction of the excursion and enjoy great inflows of capital into your account.<span id="more-68"></span></p>
<p>Instead of going through the whole process again like I did with Bumblebee, let me give you the psuedocode right quick and I&#8217;ll post the real code later. Assume the code is correct and now we are up to the backtest. I&#8217;ll do a quick backtest and post the data below. Later, I&#8217;ll run the optimization process to get a feel for how this insect performs under stress. Then I&#8217;ll follow up with walk-forward data later.</p>
<p>Ladybug takes a long position when the close is greater than the upper Keltner band. It takes a short position when the close is less than the lower Keltner band. Long positions are exited when the the close is below the simple moving average on which the ATR bands are based. Likewise logic for short exits. The simple moving average is 30 days for the initial backtest, with a ATR band of 1.5. These rules apply to White Ladybug, or the first version of the system. I&#8217;m happy to share this system, but later versions will require a non-disclosure agreement from you, in addition to copious amounts of money.</p>
<p>White Ladybug was backtested on 9 markets from 1987 to 1996. Later, we&#8217;ll run an optimization on the same period to see how robust this creature really is.</p>
<p>Here are the backtest results for nine markets on White Ladybug:</p>
<p><a href="http://milktrader.files.wordpress.com/2009/09/screenhunter_03sep-2422-11.gif"><img src="http://milktrader.files.wordpress.com/2009/09/screenhunter_03sep-2422-11.gif?w=300" border="0" alt="" /></a></p>
<p>Once again, SP 500 performs abysmally. How does one trade that stupid market anyway? On the bright side, we have crazy great results from Dollar, Yen, Gold and Coffee, with cumulative returns in excess of 300% over ten years.</p>
<p>If you look closely, you&#8217;ll see that there is some pain that must be endured to experience these results, probably more pain than can be asked of any trader, systems or not.</p>
<p>But it&#8217;s a good start on White Ladybug. As someone once said:</p>
<p>There will be time yet for a hundred indecisions,<br />
And for a hundred visions and revisions,<br />
Before the taking of a toast and tea.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=68&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/09/25/goodbye-bumblebee-hello-ladybug/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>

		<media:content url="http://milktrader.files.wordpress.com/2009/09/screenhunter_03sep-2422-11.gif?w=300" medium="image" />
	</item>
		<item>
		<title>Trade your Equity Curve</title>
		<link>http://milktrader.wordpress.com/2009/09/24/trade-your-equity-curve/</link>
		<comments>http://milktrader.wordpress.com/2009/09/24/trade-your-equity-curve/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 14:08:00 +0000</pubDate>
		<dc:creator>milktrader</dc:creator>
				<category><![CDATA[System Trading Musings]]></category>
		<category><![CDATA[Equity Curve]]></category>

		<guid isPermaLink="false">http://milktrader.wordpress.com/2009/09/24/trade-your-equity-curve</guid>
		<description><![CDATA[System traders understand that their approach to trading requires nerves-of-steel patience while in a drawdown, gut-wrenching discipline in taking every signal generated by the system (and I mean every signal &#8211; no ifs, ands, buts or maybes) and cat-like reflexes in executing signaled trades before doubt can creep into the kernel regressing, quadratic equation. Whoever [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=67&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>System traders understand that their approach to trading requires nerves-of-steel patience while in a drawdown, gut-wrenching discipline in taking every signal generated by the system (and I mean every signal &#8211; no ifs, ands, buts or maybes) and cat-like reflexes in executing signaled trades before doubt can creep into the kernel regressing, quadratic equation. Whoever said that system trading takes the emotions out of trading doesn&#8217;t know the half of it. Doubters and skeptics of system trading recite the &#8216;past performance doesn&#8217;t guarantee blah, blah, blah&#8217; mantra, refer to the perils of overfitting and data mining, and express a general independence from the enslaving nature of system trading. Well, you&#8217;ll be happy to know that you can be a system trader and not take every trade. How? Trade your equity curve. <span id="more-67"></span></p>
<p>Your system&#8217;s equity curve is how much money it&#8217;s making. Any standard package will be able to draw the simple chart for you. It has its ups and downs, with hopefully more ups for your sake. The goal for system traders is to create a smooth equity curve, meaning there are no radical departures from a gradually increasing trendline.</p>
<p>If your system&#8217;s equity curve looks sloppy and you can&#8217;t live with it, you either stop trading the ugly beast or you start a process of making it look better, which usually involves adding filters (to get the bad trades out) and other overfitting exercises. If you start down the path of overfitting so that everything looks neat and pretty, you might as well quit trading right now and donate your trading capital to a local charity. You&#8217;ll save yourself frustration and feel good about contributing to your community.</p>
<p>A natural tendency amongst system traders upon viewing an ugly equity curve is to revert to their discretionary trading habits. Take this trade, but not that one. It&#8217;s no longer system trading at that point, but discretionary trading with system tools. There is another way to maintain the integrity of the vast amounts of statistical data you acquired about your system during its development. And that is to code an algorithm to throttle or feed your system based on its equity curve performance.</p>
<p>I&#8217;ll offer three equity curves but instead of the naked one you&#8217;re used to viewing, I&#8217;ve added a MACD on a lower panel and two simple moving averages, a red one (50 day) and a green one (20 day).</p>
<p><a href="http://milktrader.files.wordpress.com/2009/09/keeptrading.gif"><img src="http://milktrader.files.wordpress.com/2009/09/keeptrading.gif?w=292" border="0" alt="" /></a><br />
The first one is a no-brainer. With an equity curve like this one, you want to keep trading it. Feed it, nurture it and read it bedtime stories.</p>
<p>It&#8217;s steadily climbing with the 20-day average nicely above the 50-day, and the MACD not showing any warning signs. If this is your equity curve, nice work.</p>
<p><a href="http://milktrader.files.wordpress.com/2009/09/proceedwithcaution.gif"><img src="http://milktrader.files.wordpress.com/2009/09/proceedwithcaution.gif?w=300" border="0" alt="" /></a><br />
Next, let&#8217;s look at one that may be in a little bit of trouble.</p>
<p>It has had a steep run-up just lately, but now the spread between the 20-day and 50-day is tightening to the point where the 20-day is threatening a breach of the 50-day. The MACD shows stalling momentum and a general decline.</p>
<p><a href="http://milktrader.files.wordpress.com/2009/09/stoptrading.gif"><img src="http://milktrader.files.wordpress.com/2009/09/stoptrading.gif?w=300" border="0" alt="" /></a><br />
Finally, let&#8217;s look at a not-so-pretty equity curve. This one has had its 20-day crossover its 50-day, and the MACD is confirming a deteriorating situation of steady decline and sub-zero line occupation.</p>
<p>Do yourself a favor, and let this system tell you what it&#8217;s going to do next before allocating anymore funds to it.</p>
<p>For system traders, it&#8217;s just a matter of programming when your system takes a trade or leaves a signal alone. You can program a moving average crossover or a host of other technical indicators that you may use in any typical trading system. You&#8217;re not being discretionary if you program <span style="font-style:italic;">under what equity curve conditions</span> a trade is taken. The programming aspects involve creating a shadow or virtual system that follows along your regular system. I haven&#8217;t programmed one yet myself, but I know I can do it in TradersStudio. I&#8217;ll post the system once I&#8217;ve gotten it correctly coded.</p>
<p>Equity curves are not unlike stocks, and stocks are not unlike equity curves. That&#8217;s why we sometimes refer to stocks as equities. Your system is basically a stock that you&#8217;ve invested time and energy into. You can employ the buy-and-hold philosophy with your system, or you can trade it.</p>
<p>To emphasize the fact that you can view your equity curve just like you would any stock, ask yourself what favorite stocks the three equity curves above look very similar to. If you guessed AAPL, IBM and F, then you&#8217;re right.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/milktrader.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/milktrader.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/milktrader.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/milktrader.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/milktrader.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/milktrader.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/milktrader.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/milktrader.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/milktrader.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/milktrader.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/milktrader.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/milktrader.wordpress.com/67/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/milktrader.wordpress.com/67/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/milktrader.wordpress.com/67/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=milktrader.wordpress.com&amp;blog=10400385&amp;post=67&amp;subd=milktrader&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://milktrader.wordpress.com/2009/09/24/trade-your-equity-curve/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/25ce2ab2f5e673e46208c1188a39e6ca?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">milktrader</media:title>
		</media:content>

		<media:content url="http://milktrader.files.wordpress.com/2009/09/keeptrading.gif?w=292" medium="image" />

		<media:content url="http://milktrader.files.wordpress.com/2009/09/proceedwithcaution.gif?w=300" medium="image" />

		<media:content url="http://milktrader.files.wordpress.com/2009/09/stoptrading.gif?w=300" medium="image" />
	</item>
	</channel>
</rss>
