<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.2" -->
<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/"
	>

<channel>
	<title>Puppetmaster Trading Blog</title>
	<link>http://puppetmastertrading.com/blog</link>
	<description>Algorithmic trading experiences</description>
	<pubDate>Sun, 24 Aug 2008 12:19:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>
	<language>en</language>
	<image>
  <link>http://puppetmastertrading.com/blog</link>
  <url>http://puppetmastertrading.com/favicon.ico</url>
  <title>Puppetmaster Trading Blog</title>
</image>
		<item>
		<title>billions and billions</title>
		<link>http://puppetmastertrading.com/blog/2008/08/22/billions-and-billions/</link>
		<comments>http://puppetmastertrading.com/blog/2008/08/22/billions-and-billions/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 15:58:13 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>back-testing</category>
	<category>technology</category>
	<category>open-source software</category>
	<category>post-trade analysis</category>
	<category>market data</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/08/22/billions-and-billions/</guid>
		<description><![CDATA[
While Carl Sagan&#8217;s famous formulation introduced a generation to the vastness of the cosmos, more recent history suggests that his memorable term might now be more aptly applied to financial extents: our deficits and debts, perhaps, to the economically or politically minded.  But for those of us with the markets on our mind, the term [...]]]></description>
			<content:encoded><![CDATA[<p><img hspace="7" align="left" alt="billions and billions" title="billions and billions" src="http://puppetmastertrading.com/images/stars.jpg" /></p>
<p>While Carl Sagan&#8217;s famous formulation introduced a generation to the vastness of the cosmos, more recent history suggests that his memorable term might now be more aptly applied to financial extents: our deficits and <a target="_blank" title="US Public Debt" href="http://en.wikipedia.org/wiki/United_States_public_debt">debts</a>, perhaps, to the economically or politically minded.  But for those of us with the markets on our mind, the term has to evoke the enormity of the data we create and must manage every day.  We&#8217;ve recently been working with the <a target="_blank" title="NYSE TAQ Data" href="http://www.nyxdata.com/nysedata/default.aspx?tabid=730">NYSE&#8217;s TAQ data</a> in an effort to integrate it into <a target="_blank" title="Puppetmaster Trading: StratBox" href="http://puppetmastertrading.com">StratBox</a>&#8217;s back-testing and optimization capabilities.  And the enormity of the data is really just staggering.</p>
<p>Each day, the NYSE publishes all of the day&#8217;s quotes and trades as well as some reference data.  Compressed, the data will just about fit onto a DVD.  For one day.  A DVD.  Compressed.  It&#8217;s really mind-boggling.  A year of the stuff, uncompressed, will require over a <em>petabyte </em>of storage.  Over 1,125,899,906,842,624 bytes.  And that&#8217;s just the US Equities markets.  You want options data, too?  I hope your uncle is named <a title="EMC - " target="_blank" href="http://www.emc.com/index.htm">EMC</a>, because just managing the data is going to be <em>a challenge</em>&#8230;</p>
<p><a id="more-39"></a></p>
<blockquote><p>“Information about money has become almost as important as money itself.” —  Walter Wriston, former Chairman of Citicorp</p></blockquote>
<p>The enormity and profile of market data far exceeds the capacity of traditional RDBMSes. While RDBMSes continue to expand their usable capacity - we have used partitioned tables with nearly a billion rows of market data which have performed  astonishingly well - they simply can&#8217;t deal with the kinds of quote volumes modern markets are generating daily.  This has spawned a host of specialized timeseries database products, like the grandaddy: <a target="_blank" title="Sungard's Fame" href="http://www.sungard.com/Fame/">Sungard&#8217;s FAME</a> which I&#8217;d used back in the 90&#8217;s to write programs to calculate bond indices at JPM, to more recent offerings like <a target="_blank" title="Vhayu" href="http://www.vhayu.com/">Vhayu</a> and <a target="_blank" title="kdb+" href="http://kx.com/">Kdb+</a>.   These timeseries oriented data products undoubtedly have many distinguishing characteristics and features, but they share one immutable characteristic: they are unbelievably expensive - in some cases a single developer seat costs in the high 6-figures for an annual license.</p>
<p>Thus, while no doubt missing out on some of their high-end features and niceties, we&#8217;ve decided to seek solutions from some of the original purveyors of petabyte-scaled data: NASA and the NCSA through their <a title="HDF5: what is it?" target="_blank" href="http://hdf.ncsa.uiuc.edu/HDF5/whatishdf5.html">HDF5</a> system.  Designed to support vast scientific data stores and boasting sophisticated capabilities in support of parallel computing environments, it should be possible to get comparable performance to some of the high-end specialized finance products without the sticker shock.  Indeed, it&#8217;s potentially <a title="Quantlib" target="_blank" href="http://puppetmastertrading.com/blog/2008/06/14/using-quantlib-from-java/">another example of free software</a> providing a meaningful contribution to finance.</p>
<p>In researching cost-efficient and highly parallel hardware solutions to pair with our emergent data solution, I&#8217;ve come to realize that open-source is expanding its reach into the hardware sphere.</p>
<p><img title="Linux cluster in an IKEA Filing cabinet" alt="Linux cluster in an IKEA Filing cabinet" src="http://puppetmastertrading.com/images/helmer.png" /></p>
<p><a target="_blank" title="Helmer" href="http://helmer.sfe.se/">This guy</a> shares his experience and &#8220;recipe&#8221; for building a powerful and unique rendering cluster inside an IKEA filing cabinet.  It&#8217;s admittedly on the funky side for even a SOHO operation, but it&#8217;s no joke - it&#8217;s more powerful than a lot of production blade servers used on wall st and it cost him less than $4K.  He also includes a (very loosely described) spec for a more powerful next-generation version with some 50-Teraflops of capacity!  So, while the data we&#8217;re having to deal with is growing at an incredible rate, the tools we have to manage it are growing proportionately for those who know how to leverage the work so many smart people are producing and freely sharing.</p>
<p>As my dad told me years ago:</p>
<blockquote><p>&#8220;Good programmers write good programs.  Great programmers <em>steal </em>good programs.&#8221;</p></blockquote>
<p>At this point, we&#8217;re still in the &#8220;discovery&#8221; stage of our development of TAQ+HDF5 for StratBox, but as we progress I&#8217;ll periodically post some of our experiences.</p>
<p>&#8212;</p>
<p>UPDATE</p>
<p>Speaking of my dad, he saw this posting and pointed me to some <a target="_blank" title="Massive Information processing and Fault-Tolerance: The Google Approach" href="http://www.cis.temple.edu/~ingargio/cis307/readings/MapReduce.html">class notes</a> he&#8217;s been working on which describe the Google approach to massive information processing and fault-tolerance.  Interesting and full of great links to both academic and industrial papers/sites on the topic.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/08/22/billions-and-billions/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>notes from the underground</title>
		<link>http://puppetmastertrading.com/blog/2008/08/11/notes-from-the-underground/</link>
		<comments>http://puppetmastertrading.com/blog/2008/08/11/notes-from-the-underground/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 20:29:08 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>dereferenced</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/08/11/notes-from-the-underground/</guid>
		<description><![CDATA[

]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://xkcd.com"><img align="middle" title="notes from the underground... day 19" alt="notes from the underground... day 19" src="http://imgs.xkcd.com/comics/babies.png" /></a>
</p>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/08/11/notes-from-the-underground/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>execution quality at the open &#038; close</title>
		<link>http://puppetmastertrading.com/blog/2008/08/01/execution-quality-at-the-open-close/</link>
		<comments>http://puppetmastertrading.com/blog/2008/08/01/execution-quality-at-the-open-close/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 22:34:02 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>back-testing</category>
	<category>strategy development</category>
	<category>performance analysis</category>
	<category>execution quality</category>
	<category>post-trade analysis</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/08/01/execution-quality-at-the-open-close/</guid>
		<description><![CDATA[
I&#8217;ve been trading an increasing amount at the open and close of the equity markets using market-on-open (MOO) and market-on-close (MOC) order types and have found that the quality of executions varies enormously between the two types and have spent a bit of time analyzing the differences which I share below.
The quick scoop is that [...]]]></description>
			<content:encoded><![CDATA[<p><img align="middle" title="Execution Quality" alt="Execution Quality" src="http://puppetmastertrading.com/images/mouseExecution.jpg" /></p>
<p>I&#8217;ve been trading an increasing amount at the open and close of the equity markets using market-on-open (MOO) and market-on-close (MOC) order types and have found that the quality of executions varies enormously between the two types and have spent a bit of time analyzing the differences which I share below.</p>
<p>The quick scoop is that MOC orders almost invariably fill at the exchange&#8217;s published closing price, while MOOs vary very substantially from the published open price.  Below I quantify my findings in a bit greater depth.</p>
<p><a id="more-37"></a></p>
<p>I looked at 846 recent MOO and MOC equity trades made over the past two months.  Of all of these trades, only one MOC trade didn&#8217;t execute at the published close and the price I got was only off by one penny.  Across all of the trades, I received the open or close price 55% of the time.</p>
<p>The remaining 45% of the time I varied from the open by an average of +.04%  This means that I actually saw a slight price <em>improvement </em>in the average case.  That is, if I was shorting then I executed at a price above the listed open and vice-versa for longs.  I&#8217;ll take it!</p>
<p>In the below chart I plot the trades against their variance, positive or negative, from the listed open or close.</p>
<p><img align="middle" alt="Variance from listed open/close" title="Variance from listed open/close" src="http://puppetmastertrading.com/images/openCloseExecs.jpg" /></p>
<p>The biggest difference was a whopping 8.56% but at least it went in my favor.  The stdev across all of the trades was .87% so we&#8217;re not looking at too disperse a grouping.</p>
<p>This data is a bit skewed as the majority of the MOO orders are going short.  This is also a pretty limited universe of trades, so I&#8217;ll continue to look at the execution quality I&#8217;m getting on these order types and will revisit it if I see any interesting changes.</p>
<p>My interpretation is that my broker is making a best-effort to get a fair open price and they&#8217;re doing a creditable job of it.  The exchanges are doing a nearly perfect job with MOC orders.</p>
<p>What impact does this have on my strategies?  I&#8217;m not sure yet, but my first blush impression is that it might be worthwhile to try to get some price improvement over the posted open price as a means of both improving the results and extending the capacity of such strategies.  It&#8217;s a favorable result as it means that strategies which back-test well on open/close data have a pretty good chance of executing well in reality.</p>
<p>A related issue, which I&#8217;m still researching, concerns the capacity of such strategies and may be the topic of a future post&#8230;
</p>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/08/01/execution-quality-at-the-open-close/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>execution quality in equity markets</title>
		<link>http://puppetmastertrading.com/blog/2008/07/30/execution-quality-in-equity-markets/</link>
		<comments>http://puppetmastertrading.com/blog/2008/07/30/execution-quality-in-equity-markets/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 17:20:02 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>performance analysis</category>
	<category>dereferenced</category>
	<category>execution quality</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/07/30/execution-quality-in-equity-markets/</guid>
		<description><![CDATA[
While doing some research on the quality and volume of executions at the open and close of US equity markets, I came across two topical research reports by Celent, a finance consultancy.  The first report is a detailed look at execution quality on nasdaq issues while the second addresses the same topic for the nyse.  [...]]]></description>
			<content:encoded><![CDATA[<p><img align="middle" alt="execution quality at the nasdaq" title="execution quality at the nasdaq" src="http://puppetmastertrading.com/images/NasdaqExecutions.jpg" /></p>
<p>While doing some research on the quality and volume of executions at the open and close of US equity markets, I came across two topical research reports by <a title="Celent " target="_blank" href="http://www.celent.com/">Celent</a>, a finance consultancy.  The first report is a detailed look at execution quality on nasdaq issues while the second addresses the same topic for the nyse.  An abstract of the first report can be found <a target="_blank" title="Nasdaq execution quality" href="http://www.celent.com/PressReleases/20080723/ExecutionQualityNasdaq.asp">here</a> and of the second <a target="_blank" title="NYSE execution quality" href="http://www.celent.com/PressReleases/200806172/ExecutionQualityNYSE.asp">here</a>.   Both are interesting enough on their own, though I&#8217;ve yet to acquire the full reports.<br />
<a id="more-36"></a> <img align="middle" title="NYSE Execution Quality" alt="NYSE Execution Quality" src="http://puppetmastertrading.com/images/NYSEExecutions.jpg" /></p>
<p>Apart the story told by these two graphics, the articles highlight a few further trends.  One is that execution quality   is dramatically improving across the board in terms of both speed and price; since 2006, NYSE execution speeds have dropped a remarkable 92%.  At the same time, the difference in price quality across venues has diverged, such that everyone will get you filled faster and better than before, but some do so with much more consistently good prices.</p>
<p>If I can get a hold of the original reports, I&#8217;ll write a more detailed review of their contents, but for now I just include the links, the catchy speed-charts and these few high-points.  For shops dealing with smart order routing algorithms, the reports might be well worth purchasing and studying directly.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/07/30/execution-quality-in-equity-markets/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>evolution of a strategy</title>
		<link>http://puppetmastertrading.com/blog/2008/07/21/evolution-of-a-strategy/</link>
		<comments>http://puppetmastertrading.com/blog/2008/07/21/evolution-of-a-strategy/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 18:17:44 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>strategy development</category>
	<category>performance analysis</category>
	<category>portfolio management</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/07/21/evolution-of-a-strategy/</guid>
		<description><![CDATA[
I mentioned several weeks ago that I&#8217;ve been developing and trading a strategy that&#8217;s proven to be quite interesting and profitable.  In that post, I described how I&#8217;d tried to improve the strategy through the use of a dynamic hedge.  The results of that crude hedge were quite good, but just as no worthwhile software [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="(d)evolution" title="(d)evolution" src="http://puppetmastertrading.com/images/devolution.jpg" /></p>
<p>I mentioned several weeks ago that I&#8217;ve been developing and trading a strategy that&#8217;s proven to be quite interesting and profitable.  In <a target="_blank" title="Unsung virtues of a dynamic hedge" href="http://puppetmastertrading.com/blog/2008/06/04/unsung-virtues-of-a-dynamic-hedge/">that post</a>, I described how I&#8217;d tried to improve the strategy through the use of a dynamic hedge.  The results of that crude hedge were quite good, but just as no worthwhile software project is ever really complete, trading strategies demand constant iterative development.</p>
<p>Below I describe some of the steps I&#8217;ve taken to incrementally improve this strategy, discarding the relatively expensive hedge I&#8217;d developed earlier in favor of a complementary strategy.  We see that when you combine two positive and uncorrelated results, you end up with a product that is literally better than the sum of its parts.</p>
<p><a id="more-35"></a></p>
<p>The core strategy has remained the same, though the universe of instruments it trades has been both expanded - through the inclusion of a broader set of equities &#038; ETFs - and contracted - through the application of some filters which prevent trading of some of the instruments under various conditions.  These change have yielded a few more points of annualized return with minimal impact on volatility.</p>
<p>As I&#8217;d mentioned, the core strategy builds a portfolio of shorts which is sold at the open and bought back at the close.  One of the problems with the original hedge is that it had a cost - literally.  In order to hedge my portfolio, I needed to cut-back the size of my portfolio to accommodate the cost of the hedge.  I mitigated this issue to some degree by employing futures instead of a broad market ETF, but this still reduced my usable capital by approximately 10-15%.  I also had my money sitting idle overnight which seemed a particularly profligate behavior.</p>
<p>This led to the study I described <a title="to dream" target="_blank" href="http://puppetmastertrading.com/blog/2008/07/14/to-dream/">last time</a> in which I observed the relative out-performance of the broad US equity markets overnight.  If I could somehow find a way to capture some of this overnight alpha, I&#8217;d be able to both hedge my main strategy and better utilize my capital.</p>
<p>My first effort at such a strategy happily achieves both aims by assembling a long portfolio which is held overnight.  In the chart below, I capture the returns of the two strategies independently and combined.  The core daytime strategy is denoted as &#8220;OpenClose&#8221; or OC whilst the night-time strategy is  &#8220;CountingSheep&#8221; or CS.  Both assume an initial capitalization of $1M, employ no leverage and do not reinvest returns - each day or night they assemble a portfolio with the same $1M and profits are put aside and don&#8217;t generate interest.</p>
<p><img align="middle" title="NightAndDay NAV Chart" alt="NightAndDay NAV Chart" src="http://puppetmastertrading.com/images/nightAndDayChart.jpg" /></p>
<p>The chart is nice and certainly a big improvement over the earlier hedged approach, but the real power of combining these two strategies is revealed in the two tables below.  The first characterizes their risk-adjusted performance independently and then when combined.  Both have a Sharpe ratio of around 2.0, but when combined they yield a new strategy which is about 25% better on a risk-adjusted basis.  These cells are highlighted.<br />
<img align="middle" title="Returns" alt="Returns" src="http://puppetmastertrading.com/images/nightAndDayReturns.jpg" /></p>
<p>The key to their compatibility is their correlation.  Or, actually, their absence of correlation.  In the below table, you can see the correlations of their returns to one another and broad market ETFs.  The short daytime strategy is, not surprisingly, negatively correlated with the broad market while the long night time strategy is positively correlated.  The beauty of their combination lies in the lack of correlation between the two of them (highlighted) - they&#8217;re essentially uncorrelated.</p>
<p><img align="middle" alt="Correlation matrix" title="Correlation matrix" src="http://puppetmastertrading.com/images/nightAndDayCorrs.jpg" /></p>
<p>I hope this post illustrates a couple of different vectors along which strategies can be evolved; in this case, to better manage risk and utilize capital.</p>
<p>One of the key remaining limitations of this particular strategy is its capacity.  Increasing the capacity of a relatively short-term strategy like this one requires optimization of the trade executions which is its own black art but one that plenty of smart people are constantly addressing.  Perhaps in a future post I&#8217;ll review some of the techniques applied to this problem for another perspective on the iterative development/evolution of trading strategies.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/07/21/evolution-of-a-strategy/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>to dream</title>
		<link>http://puppetmastertrading.com/blog/2008/07/14/to-dream/</link>
		<comments>http://puppetmastertrading.com/blog/2008/07/14/to-dream/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 20:31:26 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>back-testing</category>
	<category>strategy development</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/07/14/to-dream/</guid>
		<description><![CDATA[ People have long imagined ways to make money while they slept.  Happily, it&#8217;s not a pursuit I&#8217;m particularly bothered by, but as I develop trading strategies, I do make note of different market behaviors that correlate to the time of day.  Or night.
In particular, I&#8217;ve been looking at various market-breadth ETFs recently as possible [...]]]></description>
			<content:encoded><![CDATA[<p><img hspace="7" align="left" title="..." alt="..." src="http://puppetmastertrading.com/images/makeMoneyWhileYouSleep.jpg" /> People have long imagined ways to make money while they slept.  Happily, it&#8217;s not a pursuit I&#8217;m particularly bothered by, but as I develop trading strategies, I do make note of different market behaviors that correlate to the time of day.  Or night.</p>
<p>In particular, I&#8217;ve been looking at various market-breadth ETFs recently as possible fodder for the little dynamic hedger I&#8217;ve described <a title="unsung virtues of a dynamic hedge" target="_blank" href="http://puppetmastertrading.com/blog/2008/06/04/unsung-virtues-of-a-dynamic-hedge/">before</a>, and I&#8217;ve noticed an interesting behavior among several of them&#8230;</p>
<p><strong>Like the majority of traders, they do better when they&#8217;re not trading!</strong></p>
<p>That is, they actually  display better performance at night than they do during the regular trading day; there&#8217;s more profit to be had in their gaps between sessions than there is during trading sessions.  Below I quantify this observation more thoroughly&#8230;</p>
<p><a id="more-34"></a>I looked at the performance of a variety of ETFs across three super-simple &#8220;strategies&#8221;. The first of them trades overnight - buying the close and selling the following morning&#8217;s open.  The next buys at the open and sells at the close.  And the final one is, essentially, buy and hold though it&#8217;s implemented as a buy at close, sell and buy at following close.  No costs or slippage are included.  The table below details the results for the SPY (S&#038;P 500), IWM (Russell 2000) and QQQQ (Nasdaq 100).</p>
<p>In all cases, the ETFs perform better overnight - they make more and have almost precisely half the risk, yielding very substantially better risk-adjusted performance measures (here sharpe is calculated with a constant 5% risk-free rate). These cases are highlighted in yellow in the table.  Likewise, the worst performer in all cases was the &#8220;day-trader&#8221; who bought on the open and sold on the close.  One thing to note about the below summary is that all data is taken from inception for each of the ETFs, so their duration varies!  (For the SPY, since 1/29/1993; for the IWM, since 5/26/200 and for the QQQQ since 3/10/1999).<br />
<img align="middle" alt="I dream of ETFs..." title="I dream of ETFs..." src="http://puppetmastertrading.com/images/etfDreams.jpg" /></p>
<p>I tried the same analysis across a few other ETFs to see if the effect was a global one or a US-specific phenomenon.  The results are mixed but likely negative for Europe (EWG), Japan (EWJ) and broad foreign markets (EFA).  I&#8217;m not going to summarize that data here, but you can grab the excel workbook I used for this exercise <a title="Excel workbook with relevant data" target="_blank" href="http://puppetmastertrading.com/images/todream.xlsx">here</a>, though I warn you in advance that it&#8217;s about 2.3M.  (If you find errors - please point them out!)</p>
<p>[UPDATE: .XLS 97-2003 version available <a target="_blank" title="Excel 1997-2003 version" href="/images/todream.xls">here</a> is ~3M]</p>
<p>For the US markets summarized in the table, the conclusion is pretty explicit - the great majority of the market&#8217;s profits are attained overnight. Even worse: in spite of the positive returns across all of these markets over the relevant periods, all of them show significantly negative intraday performance.</p>
<p>For long-only day-traders, this is the kind of result that should cause nightmares!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/07/14/to-dream/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>if</title>
		<link>http://puppetmastertrading.com/blog/2008/07/14/if/</link>
		<comments>http://puppetmastertrading.com/blog/2008/07/14/if/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 15:58:27 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>dereferenced</category>
	<category>guests</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/07/14/if/</guid>
		<description><![CDATA[


]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="344"><br />
<param name="movie" value="http://www.youtube.com/v/3AJqESdw7xs&#038;hl=en&#038;fs=1"></param>
<param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/3AJqESdw7xs&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/07/14/if/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>a stat arb story</title>
		<link>http://puppetmastertrading.com/blog/2008/07/12/a-stat-arb-story/</link>
		<comments>http://puppetmastertrading.com/blog/2008/07/12/a-stat-arb-story/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 14:47:40 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>strategy development</category>
	<category>portfolio management</category>
	<category>dereferenced</category>
	<category>hedge funds</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/07/12/a-stat-arb-story/</guid>
		<description><![CDATA[The always excellent Wilmott Magazine has recently posted a series of articles by Ed Thorp (pictured) in which he describes his experiences developing and evolving a statistical arbitrage product.  Part I provides some insights into his current operation, revealing that he maintains a dollar-neutral portfolio as I&#8217;d discussed in another post, they trade some 1.5 [...]]]></description>
			<content:encoded><![CDATA[<p><img hspace="7" align="left" alt="Ed Thorp" title="Ed Thorp" src="http://puppetmastertrading.com/images/ed_thorp.jpg" />The always excellent <a target="_blank" title="Wilmott" href="http://wilmott.com">Wilmott Magazine</a> has recently posted a series of articles by <a target="_blank" title="Ed Thorp" href="http://en.wikipedia.org/wiki/Edward_O._Thorp">Ed Thorp</a> (pictured) in which he describes his experiences developing and evolving a <a target="_blank" title="Statistical Arbitrage" href="http://en.wikipedia.org/wiki/Statistical_arbitrage">statistical arbitrage</a> product.  <a target="_blank" title="Ed Thorp, Statistical Arbitrage - Part I" href="http://puppetmastertrading.com/images/080617_thorp.pdf">Part I</a> provides some insights into his current operation, revealing that he maintains a dollar-neutral portfolio as I&#8217;d discussed in another <a target="_blank" title="Unsung virtues of a dynamic hedge" href="http://puppetmastertrading.com/blog/2008/06/04/unsung-virtues-of-a-dynamic-hedge/">post</a>, they trade some 1.5 billion shares / year, and that they limit position sizes to 2.5% on the long side of the portfolio and 1.5% on the short side.  In <a target="_blank" title="Ed Thorp, Statistical Arbitrage - Part II" href="http://puppetmastertrading.com/images/080630_thorp.pdf">Part II</a>, he explains why a stat arb system is considered an &#8220;arbitrage&#8221; and how, with the help of a talented team and led by the insights of Gerry Bamberger, they developed the first iteration of a stat arb product.  <a title="Ed Thorp, Statistical Arbitrage - Part III" target="_blank" href="http://puppetmastertrading.com/images/080709_thorp.pdf">Part III</a> details the evolution of the system from a set of dollar-neutral sector-oriented portfolios to the more general sets of portfolios generated through statistical factor analysis.  He concludes with some anecdotes including the emergence of <a title="David E Shaw" target="_blank" href="http://www.deshaw.com/Founder.html">David E Shaw</a>.  Very recommended.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/07/12/a-stat-arb-story/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>perils of parameterization</title>
		<link>http://puppetmastertrading.com/blog/2008/07/08/perils-of-parameterization/</link>
		<comments>http://puppetmastertrading.com/blog/2008/07/08/perils-of-parameterization/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 16:05:11 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>back-testing</category>
	<category>strategy development</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/07/08/perils-of-parameterization/</guid>
		<description><![CDATA[
I came across and had to share this excellent vignette by Freeman Dyson on the perils of excess model parameterization&#8230;
In desperation I asked Fermi whether he was not impressed by the agreement between our calculated numbers and his measured numbers. He replied, “How many arbitrary parameters did you use for your calculations?” I thought for [...]]]></description>
			<content:encoded><![CDATA[<p><img align="top" title="What he might do with 6 parameters?..." alt="What he might do with 6 parameters?..." src="/images/elephant_cartoon.jpg" /></p>
<p>I came across and had to share this excellent vignette by <a target="_blank" title="original PDF article " href="http://cmm.cit.nih.gov/~hassan//dyson.pdf">Freeman Dyson</a> on the perils of excess model parameterization&#8230;</p>
<blockquote><p>In desperation I asked Fermi whether he was not impressed by the agreement between our calculated numbers and his measured numbers. He replied, “How many arbitrary parameters did you use for your calculations?” I thought for a moment about our cut-off procedures and said, “Four.” He said, “I remember my friend Johnny von Neumann used to say, with four parameters I can fit an elephant, and with five I can make him wiggle his trunk.”</p></blockquote>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/07/08/perils-of-parameterization/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>using Quantlib from Java</title>
		<link>http://puppetmastertrading.com/blog/2008/06/14/using-quantlib-from-java/</link>
		<comments>http://puppetmastertrading.com/blog/2008/06/14/using-quantlib-from-java/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 14:52:39 +0000</pubDate>
		<dc:creator>tito</dc:creator>
		
	<category>monte-carlo methods</category>
	<category>technology</category>
	<category>FIX Protocol</category>
	<category>open-source software</category>
	<category>options pricing</category>
		<guid isPermaLink="false">http://puppetmastertrading.com/blog/2008/06/14/using-quantlib-from-java/</guid>
		<description><![CDATA[
One of these days I&#8217;m going to give an overview of all the excellent open-source software I use on a daily basis.  Until that day comes, I&#8217;ll observe that finance remains one of the big areas where open-source software has made relatively limited inroads.
Two production-quality packages fight that unhappy state: QuantLib - a comprehensive [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="A free/open-source library for quantitative finance" title="A free/open-source library for quantitative finance" src="http://puppetmastertrading.com/images/QL-title.jpg" /></p>
<p>One of these days I&#8217;m going to give an overview of all the excellent open-source software I use on a daily basis.  Until that day comes, I&#8217;ll observe that finance remains one of the big areas where open-source software has made relatively limited inroads.<img align="right" alt="Java" title="Java" src="/images/javabrew.jpg" /></p>
<p>Two production-quality packages fight that unhappy state: <a target="_blank" title="QuantLib: A free/open-source library for quantitative finance" href="http://quantlib.org">QuantLib</a> - a comprehensive framework for quantitative finance - and <a target="_blank" title="QuickFix: Open-source FIX engine" href="http://www.quickfixengine.org/">QuickFix</a> - a full-featured <a title="Financial Information eXchange" target="_blank" href="http://fixprotocol.org">FIX</a> engine.   Both are C++ libraries and both provide very nice interfaces to facilitate integration with other languages, including Java.  QuantLib is a big and complicated library and integrating it with Java is not totally obvious. Below, I&#8217;ll describe how to build and use QuantLib from Java.</p>
<p><a id="more-29"></a> These instructions are based on a unix installation.  I&#8217;m not really a windows developer and don&#8217;t have all the shiny tools that windows developers use, so it&#8217;s not an area of focus for me.  That said, I have managed to build QuantLib under windows by using <a title="MIinGW+MSYS: Linux in a box" target="_blank" href="http://www.mingw.org/">MinGW+MSYS</a> but it wasn&#8217;t terribly easy and I don&#8217;t currently have a working installation, so I won&#8217;t cover that here.  If this is your aim, don&#8217;t be dismayed as it is possible and it had all the functionality I enjoy under linux.</p>
<p><strong>Using QuantLib from Java (on linux)</strong></p>
<ul>
<li>Build QuantLib</li>
<ul>
<li>Requires a working version of <a title="Boost C++ Library" target="_blank" href="http://www.boost.org/">Boost</a>.   This may prove to be the hardest step of all and you&#8217;ll need to use the ample documentation provided by the Boost team.</li>
<li>Once you have a working copy of Boost, building QuantLib should require little more than</li>
<p><code>sh autogen.sh</code><br />
<code>./configure</code><br />
<code>make</code><br />
<code>sudo make install</code></ul>
<li>Build QuantLib-SWIG</li>
<ul>
<li>Requires a working copy of <a target="_blank" title="SWIG - Simplified Wrapper and Interface Generator" href="http://www.swig.org/">SWIG</a>.  Again, look to the SWIG instructions, but it should be easy.</li>
<li>Once SWIG is available, building the QuantLib/SWIG interfaces should only require:</li>
<p><code>sh autogen.sh</code><br />
<code>./configure \<br />
--with-jdk-include=${JAVA_HOME}/include \<br />
--with-jdk-system-include=${JAVA_HOME}/include/linux</code><br />
<code>make -C Java</code><br />
<code>sudo make install</code></ul>
</ul>
<ul>
<li>Now you&#8217;ll have a Jar file with all of the SWIG/JNI stubs in it available in /usr/local/lib/QuantLib.jar.  Add this to your classpath.</li>
<li>Programs which call QuantLib functionality will need to have the <code>LD_LIBRARY_PATH</code> set.  This can be done by invoking the vm with something like:</li>
<p><code>-Djava.library.path=/usr/local/lib </code></ul>
<ul>
<li>Programs which call QuantLib functionality will also need to explicitly load the QuantLib libraries.  This can be done with something like the following static block appearing before your main method:</li>
<p><code>       static {  // Load QuantLib<br />
try { System.loadLibrary("QuantLibJNI"); }<br />
catch (RuntimeException e) { e.printStackTrace(); }<br />
}     </code></p>
<li>That&#8217;s it.  Now test your configuration by running the examples in Quantlib-SWIG/Java/examples.</li>
</ul>
<p>It&#8217;s worth understanding how Quantlib is being used from java.  SWIG is creating a JNI interface into those methods within Quantlib which have been exposed through their declaration in the swig *.i files.  These files are found in Quantlib-SWIG/SWIG and they determine what functionality from Quantlib will be available to you.  You&#8217;ll likely need to get familiar with a subset of those files that you care about. If you find that some functionality you care about isn&#8217;t exposed in those files, you may need to expose it yourself.</p>
<p>There&#8217;s a learning curve, but it&#8217;s worth traversing so you can get at all the rich functionality so many smart people have put together.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://puppetmastertrading.com/blog/2008/06/14/using-quantlib-from-java/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
