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

<channel>
	<title>Hack the market &#187; post-trade analysis</title>
	<atom:link href="http://www.puppetmastertrading.com/blog/index.php/category/post-trade-analysis/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.puppetmastertrading.com/blog</link>
	<description>Algorithmic trading experiences</description>
	<lastBuildDate>Wed, 21 Apr 2010 23:11:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>dingbat kabuki</title>
		<link>http://www.puppetmastertrading.com/blog/2010/01/28/dingbat-kabuki/</link>
		<comments>http://www.puppetmastertrading.com/blog/2010/01/28/dingbat-kabuki/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 13:08:01 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[execution quality]]></category>
		<category><![CDATA[market structure]]></category>
		<category><![CDATA[our managed markets]]></category>
		<category><![CDATA[post-trade analysis]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog/?p=973</guid>
		<description><![CDATA[ Like many Americans, last night I dutifully switched on my TV at 9pm to see the State of our Union.  Always a spectacle, America&#8217;s leadership have upped the surreality ante with the bizarre backdrop of Biden lip-synching amiably in the background whilst Madame Speaker sat with all the calm collection of a fish on [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="/images/kabuki.gif" alt="" width="200" height="304" /> Like many Americans, last night I dutifully switched on my TV at 9pm to see the State of our Union.  Always a spectacle, America&#8217;s leadership have upped the surreality ante with the bizarre backdrop of Biden lip-synching amiably in the background whilst Madame Speaker sat with all the calm collection of a fish on a hook and never seemed fully in control of herself or her eyebrows.  The spectacle of would&#8217;ve-been king McCain sitting there and glowering openly at the lecturn as his confederates sat in stony silence while their &#8216;opposition&#8217; applauded like drunken high schoolers at a home coming at every mundane utterance proved a bit much and I had turned off the glowing beacon of groupthink by 9:25 and gone to investigate something on my computer.  I was surprised and delighted to see that it was still available: dingbatkabuki.com</p>
<p><strong>Dingbat Kabuki and other <em>structural</em> market hacks</strong></p>
<p>When I first started puppetmaster trading, one of my dearest friends, a Yale-educated economist and professor of same, asked me an important question.  He asked:</p>
<blockquote><p>In the markets, there are always &#8216;insiders&#8217; who have the ability to trade on knowledge that you <em>can&#8217;t</em> know or with an advantage that you <em>can&#8217;t</em> have.  How are you going to compete with these players?</p></blockquote>
<p>I provided a variety of answers, but at the time my conception of the universe of people with both inside knowledge and the ability to trade on it was limited to cases like that of Mr Rajaratnam.  I believed that cases like these were constrained by clear laws that were duly surveilled and prosecuted by the appropriate authorities.  The problem seemed like a very real one, but constrained in size and not essential to my enterprise.  I still hope that my belief of the time was true, but since then I&#8217;ve certainly understood that there&#8217;s more than one way to hack the market.</p>
<p>For some, a market hack might consist of some kind of simple (or complex) algorithm(s) applied to some set of markets.  But this really isn&#8217;t a hack so much as it&#8217;s a trading strategy &#8211; like many that have long existed &#8211; only that it&#8217;s now implemented in software where originally it would have been implemented in wetware.  While implementing trading strategies in software does open up new vistas in terms of the kinds of strategies that you can look to implement &#8211; computers are faster than people by a noteworthy amount in many tasks &#8211; but, for the most part, you&#8217;re really still just trading and when you take on positions, you are still bearing risk.  You might be &#8216;hacking&#8217; but it&#8217;s really not a market hack as I&#8217;ve come to appreciate.</p>
<p><span id="more-973"></span></p>
<p><strong>hack the market structure </strong></p>
<p>Another area where my perspective has changed substantively since those halcyon days of &#8216;05 is my appreciation for market (micro) structure.  In futures, market structure is pretty plain as most contracts are effectively monopolies run by their listing exchanges.  There are a few cases of instruments which are tradable across markets, but a rich market microstructure is just not a core identifying characteristic for futures like it is in the fragmented and incredibly dynamic and quickly developing world of equities.  So, while there are some dozens of futures exchanges scattered about the globe, as a futures trader, routing algorithms just don&#8217;t enter the picture except in limited and relatively simple cases.</p>
<p>If I have a view on or a hedging need for interest rates that I see effectively expressed through futures, then I go to e.g. the cme and I don&#8217;t need to worry my pretty head about getting a great execution because the exchange is in one place and it&#8217;s all lit up and filled to the brim with liquidity.  Easy peasy.  But if I have a view on, say, General Electric that I want to express with an equity position and I&#8217;m trading in sufficient size or sufficiently close to the market that I really want to ensure best execution, then I might find the need to look around some dozens of lit exchanges and maybe even ping about in a dark pool or twelve.  This is decidedly not easy peasy and is one of the reasons wall st has an insatiable hunger for propeller heads with advanced degrees in seemingly unrelated fields.</p>
<p>Last summer&#8217;s brouhaha about &#8216;flash&#8217; orders first illuminated for many a rich ground for genuine market hacks: the incredibly dynamic terrain of equity market micro structure which changes almost daily with the emergence of new exchanges, ATSes, order types, rebates and pricing structures and all of the many other critical minutia that differentiate the many venues.  Some of these undoubtedly provide meaningful and important services; contrary to populist inclination, dark pools are largely a defense <em>against</em> frothy HF trading strategies.</p>
<p>But the concern (if perhaps not all of the attention) is <a title="Rosenblatt's view on HF Trading" href="http://hft.thomsonreuters.com/files/2009/11/Rosenblatt-HFTexcerpt4Reuters2.pdf" target="_blank">merited</a>.   Equity microstructural &#8216;rules&#8217; change so quickly that even independent and upright regulators could hardly be expected to keep up.  This is clearly fertile ground for genuine &#8211; if perhaps fleeting &#8211; market hacks.</p>
<p><strong><a title="Wiki: Steganography" href="http://en.wikipedia.org/wiki/Steganography" target="_blank">steganography</a> and hacking the market<br />
</strong></p>
<p>What characteristics make equity market structure a fertile ground for these kinds of genuine market hacks which I&#8217;m describing?  I think the main answer is to be found in the ancient art of steganography &#8211; hiding in plain site.  Everything about equity market microstructure is public.  All of the rules for each of the venues are available to the people who might make use of them.  Unraveling what they <em>imply</em> about where you should be executing for any given order is the tricky bit which is hardly revealed through a simple reading of all of the various rules.</p>
<p>Where else do we see this phenomenon?  The US Tax code comes to mind (sort of like the iPhone: &#8220;there&#8217;s a loophole for that&#8221;).  The 2,000 page health care bill comes to mind.  Everybody seems to care about health care, but who&#8217;s actually read that bill?  Who could?</p>
<p>Totally public yet it may as well be encrypted.  Steganography.</p>
<p>Elizabeth Warren has also made this observation in the context of contracts made between banks and their retail clientele.  Noted scholar Scott Adams dubbed it a &#8216;<a title="Wiki: Confusopoly" href="http://en.wikipedia.org/wiki/The_Dilbert_Future" target="_blank">confusopoly</a>.&#8217;</p>
<blockquote><p><em>a group of companies with similar products who intentionally confuse customers instead of competing on price</em></p></blockquote>
<p>So, could people hack the tax code?  <a title="Hanky panky" href="http://www.puppetmastertrading.com/blog/2009/01/08/and-this-little-piggy-hollowed-out-our-nation/" target="_blank">Hank</a> and I think so.  So do my friends in the <a title="Play by the rules" href="http://www.puppetmastertrading.com/blog/2009/04/13/playing-by-the-rules/" target="_blank">lobbying business</a>.  How about all those recently converted bank holding companies &#8211; hack much?  In my last post we read one insider&#8217;s view that Madoff had effectively hacked the SEC&#8230; perhaps regulatory organizations themselves are also hackable instruments!  How about that health care bill?  &#8230;</p>
<p><strong>misdirecting the hack</strong></p>
<p>A lot of attention has focused recently on exchange traded markets and people are up in arms about HF traders and proprietary trading.  I&#8217;ve argued <a title="it's not about microstructure" href="http://www.puppetmastertrading.com/blog/2009/08/07/its-not-about-microstructure/" target="_blank">before</a> that this appears to be a great ploy to take attention away from the real issues at hand; in the worst case, HFT improprieties might account for no more than 1% of the money <em>disappeared</em> in the last few years as part of the so-called &#8216;credit crisis&#8217;.  It&#8217;s easy for non-finance-professionals not to understand that the big bad wolves of the credit crisis essentially all happened off market in essentially unregulated multi-trillion dollar otc markets of <a title="perfect crime" href="http://www.puppetmastertrading.com/blog/2009/11/02/perfect-crime/" target="_blank">ingeniously engineered</a> structured products. These are the <em>real</em> market hackers.  Exchange traded instruments had effectively nothing to do with our current circumstances but remain a convenient scapegoat.</p>
<p>Some argue persuasively that there are fundamental, <a title="Murray Rothbard: The Case Against the Fed" href="http://mises.org/books/fed.pdf" target="_blank">structural market hacks</a> at the very foundations of our financial system.  I wouldn&#8217;t know.  But it is the kind of thing one might think about while watching the highly stylized performance of our leaders last night.</p>
<p><strong>dingbat kabuki and the transparent market hack</strong></p>
<p>To my knowledge, Cal&#8217;s (go bears!) Professor Brad DeLong coined the term &#8216;dingbat kabuki&#8217; back in 2005 in <a title="the original" href="http://delong.typepad.com/sdj/2005/10/dingbat_kabuki_.html" target="_blank">shrill response</a> to a Washington Post article.  He reprised the term this week in response to the latest bit of <a title="Andrew Mellon's rotting corpse" href="http://delong.typepad.com/sdj/2010/01/barack-herbert-hoover-obama.html" target="_blank">macroeconomic genius</a> out of washington.  What an inspired phrase.  Yesterday at 2:30 and last night at 9pm the markets voiced their applause and cheered on the performance.</p>
<p>Indeed, it is masterful.</p>
<p>&#8211;</p>
<p>A technical note about this post.  While writing it, I seem to have accidentally published it at some point and then realized the error and &#8216;unpublished&#8217; it.  I apologize if this had any untoward effects on you or your RSS reader.</p>
<p><strong><br />
</strong></p>
<p style="text-align: center;"><img class="aligncenter" src="/images/musashi.jpg" alt="" width="677" height="325" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.puppetmastertrading.com/blog/2010/01/28/dingbat-kabuki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>managing tick data with hdf5</title>
		<link>http://www.puppetmastertrading.com/blog/2009/01/04/managing-tick-data-with-hdf5/</link>
		<comments>http://www.puppetmastertrading.com/blog/2009/01/04/managing-tick-data-with-hdf5/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 18:45:36 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[EMS Internals]]></category>
		<category><![CDATA[market data]]></category>
		<category><![CDATA[open-source software]]></category>
		<category><![CDATA[post-trade analysis]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog/?p=262</guid>
		<description><![CDATA[
One of the nicest things about the holiday season (Happy New Year, btw) is that it provides a lovely opportunity to spend some quality time with a project that&#8217;s a bit more exploratory than might be meaningfully undertaken while trading in lively markets.
A number of months ago, I mentioned using HDF5 to manage tick data [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="margin-left: 5px; margin-right: 5px;" title="big data" src="/images/bigdata.jpg" alt="" width="328" height="248" /></p>
<p>One of the nicest things about the holiday season (Happy New Year, btw) is that it provides a lovely opportunity to spend some quality time with a project that&#8217;s a bit more exploratory than might be meaningfully undertaken while trading in lively markets.</p>
<p>A number of months ago, I <a title="billions and billions" href="http://www.puppetmastertrading.com/blog/2008/08/22/billions-and-billions/" target="_blank">mentioned</a> using <a title="HDF5" href="http://www.hdfgroup.org/HDF5/" target="_blank">HDF5</a> to manage tick data as RDBMSes just aren&#8217;t up to the task and specialized Tick DBs are absurdly expensive.  While I&#8217;d spent some time exploring this idea through the fall, I never had a discrete chunk of time to really explore the technology beyond determing that its Java interfaces weren&#8217;t production-worthy.  This meant that we&#8217;d have to drop into C to access the functionality we&#8217;re interested in and that we&#8217;d have to come up with our own bridge out into Java for access by StratBox while StratCloud could access it directly.</p>
<p>Below, I describe what I&#8217;ve learned through my holiday geek-spelunking-trek including some timings on various configurable characteristics of HDF5 (e.g., compression and &#8220;chunking&#8221;).</p>
<p><span id="more-262"></span></p>
<p>After spending some time looking at the java interfaces to HDF5, I determined it wasn&#8217;t up to snuff.  Why?  Primarily because no-one seems to use it, it lags the main api from a versioning standpoint and it appears to be more-or-less impossible to build from source.  Looking a bit more carefully, it seems to have been written by one (undoubtedly talented and well-meaning) individual who isn&#8217;t familiar with java.  (The most egregious example was to use a javax.swing.tree.TreeNode as the base class for a key model object&#8230;)</p>
<p>I then spent some time looking at the native api and the underlying object model it exposes.  The model is both powerful and pretty low-level.  They&#8217;ve implemented many of the goodies of a file system including groups (&#8220;directories&#8221;), datasets (&#8220;files&#8221; or in RDBMS-land, &#8220;tables&#8221;) and a variety of nice linking mechanisms as well as attributes which might index or otherwise annotate data.  There&#8217;s also powerful, extensible I/O options which I didn&#8217;t much study beyond compression and &#8220;chunking.&#8221;</p>
<p>The library is provided with two &#8220;first-class&#8221; APIs &#8211; in C and Fortran &#8211; a secondary API in C++ and then the Java interface I mentioned.  Others have written interfaces for other languages, most notably the much-lauded <a title="PyTables" href="http://www.pytables.org" target="_blank">PyTables</a> implementation for Python which is used by many in conjunction with the popular <a title="Numpy" href="http://numpy.scipy.org/" target="_blank">NumPy</a> package.</p>
<p>Given this spread of implementation languages I chose C and determined that I&#8217;d steal a page from the talented crew behind <a title="QuantLib" href="http://quantlib.org" target="_blank">QuantLib</a> and use <a title="Simplified Wrapper and Interface Generator" href="http://www.swig.org/" target="_blank">SWIG</a> to expose relevant functionality into Java.  This has proven to be a splendid choice for my needs.</p>
<p>Having gotten this far, I started examining how I&#8217;d represent market data with hdf5 and came up with two broadly opposed approaches.  In order to gain some insights from those more experienced, I sent the below problem statement / inquiry to the main HDF5 mailing list:</p>
<blockquote><p><span style="font-weight: bold;">A description of the data and its use</span></p>
<p>The data is all timestamped financial streams of &#8220;tick&#8221; data.  Each record is small (a few hundred bytes at the most), but there are many &#8211; in a day you may see many hundred million to a few billion.  Each record is naturally partitioned by instrument (eg, &#8220;microsoft&#8221;, &#8220;ibm&#8221;, &#8220;dec crude&#8221;, etc).  There are less than 30K instruments in the universe I might care about.</p>
<p>I (more or less) don&#8217;t care how long it takes to construct the h5 files/structures as it will be performed offline and the only critical query I care about is something like:</p>
<div style="margin-left: 40px;"><span style="font-style: italic;">&#8220;Get ticks for instruments {i1&#8230;in} from time t1 to time t2 ordered by time, instr&#8221;. </span></div>
<p>That is, I need to be able to &#8220;replay&#8221; a subset of the instruments within the data store over some period of time.  But I really care that this be as fast as possible.</p>
<p><span style="font-weight: bold;">Questions </span></p>
<p>0.  Am I barking up the wrong tree?  Is HDF5 an appropriate technology for the use I&#8217;ve described?</p>
<p>1. Given the size/volume of the data, my thought is to partition h5 files by day.  Uncompressed, the files will be on the order of ~25G.  Does this sound reasonable?  What are the key factors impacting this decision from an hdf5 perspective?</p>
<p>Two alternative models come immediately to mind: one big table (OBT) per day ordered by instrument and then time, or one table per instrument (OTPI) ordered by time.  My current inclination is OTPI as it seems more manageable assuming the overhead of so many tables isn&#8217;t an issue.</p>
<p>2a.  Are there other, better models you suggest I investigate?</p>
<p>2b.  With the OBT, I&#8217;d need to be able &#8220;index into&#8221; the table to identify the beginning of each instrument&#8217;s section (at least).  How would you recommend doing this?  It seems possible to do this with references or perhaps a separate table with numerical indices into the main table.  Any pros/cons/alternatives to these approaches?</p>
<p>2c.  With the OTPI, I&#8217;d need to have many tables (at most ~30K) per file.  Is this an issue?</p>
<p>2d. For both models, I&#8217;d need to be able to merge sorted sets of h5 data into one sorted set as quickly as possible.  Is there any hdf5 support for doing such a thing or external libraries created for this purpose?</p>
<p>3. What impact on retrieval/querying should I expect to see with varying levels of  compression?</p>
<p>4. Any suggestions on chunksizes for this application?</p></blockquote>
<p>I was fortunate to receive some excellent responses to my query, including from Francesc Alted, the gracious author of the PyTables library, and from a gentleman who&#8217;d implemented similar functionality for his own trading environment.  Interestingly, both approaches &#8211; OBT and OTPI &#8211; were championed.  It seems that OTPI is probably to be preferred if the number of instruments/tables to be stored isn&#8217;t excessive (perhaps below 10K though I can&#8217;t quantify this) and the frequency of update is significant.  OTPI is easier to implement as it means you can rely more upon the infrastructure provided by HDF5.  OBT instead seems more scalable as you incur less overhead (and goodies) with the one table, though you pay for this by having to implement your own indexing logic.</p>
<p>Given the divergent advice and my own lack of hands-on familiarity with the C library, I decided to try both approaches on a prototype.  Instead of looking at vast amounts of tick data, I&#8217;d try both approaches on a smaller store  (~1G with ~7K instruments) of OHLCV data.</p>
<p>By far, the easier to implement is the OTPI approach.  However, even with this relatively small amount of data, the difference in write performance and file size was substantial.  Clearly, expanding this to the scale of tick data wasn&#8217;t going to yield sufficiently performant results.  I focused on the OBT approach.</p>
<p>&#8212;</p>
<p>Given the length of this post and keeping in mind that the holiday season isn&#8217;t over just yet (about ten hours remaining as I write this!), I&#8217;m going to stop writing now and continue with the remainder of my implementation and findings in a follow-up post later this week..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puppetmastertrading.com/blog/2009/01/04/managing-tick-data-with-hdf5/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>billions and billions</title>
		<link>http://www.puppetmastertrading.com/blog/2008/08/22/billions-and-billions/</link>
		<comments>http://www.puppetmastertrading.com/blog/2008/08/22/billions-and-billions/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 16:21:22 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[back-testing]]></category>
		<category><![CDATA[market data]]></category>
		<category><![CDATA[open-source software]]></category>
		<category><![CDATA[post-trade analysis]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog-test/?p=81</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 [...]]]></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><span id="more-81"></span></p>
<blockquote><p>&#8220;Information about money has become almost as important as money itself.&#8221; &#8212; 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 &#8211; we have used partitioned tables with nearly a billion rows of market data which have performedÂ  astonishingly well &#8211; 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 &#8211; 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 &#8211; 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://www.puppetmastertrading.com/blog/2008/08/22/billions-and-billions/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>execution quality at the open &amp; close</title>
		<link>http://www.puppetmastertrading.com/blog/2008/08/01/execution-quality-at-the-open-close/</link>
		<comments>http://www.puppetmastertrading.com/blog/2008/08/01/execution-quality-at-the-open-close/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 15:50:35 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[back-testing]]></category>
		<category><![CDATA[execution quality]]></category>
		<category><![CDATA[performance analysis]]></category>
		<category><![CDATA[post-trade analysis]]></category>
		<category><![CDATA[strategy development]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog-test/?p=77</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><span id="more-77"></span></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://www.puppetmastertrading.com/blog/2008/08/01/execution-quality-at-the-open-close/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
