<?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; options pricing</title>
	<atom:link href="http://www.puppetmastertrading.com/blog/index.php/category/options-pricing/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>Kooderive</title>
		<link>http://www.puppetmastertrading.com/blog/2010/02/03/kooderive/</link>
		<comments>http://www.puppetmastertrading.com/blog/2010/02/03/kooderive/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 15:31:20 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[EMS Internals]]></category>
		<category><![CDATA[dereferenced]]></category>
		<category><![CDATA[monte-carlo methods]]></category>
		<category><![CDATA[open-source software]]></category>
		<category><![CDATA[options pricing]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog/?p=1000</guid>
		<description><![CDATA[Some time back, I&#8217;d written about NVidia&#8217;s CUDA noting that it looked ideal for many asset-pricing and monte-carlo type problems in finance.  At the time, I was hopeful that it would be quickly integrated into existing open source efforts like QuantLib, but adoption has proved slower than I&#8217;d hoped, most likely because implementing non-trivial problems [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignleft" style="width: 240px"><img class="   " src="/images/cuda_simonRogerson.jpg" alt="photo by Simon Rogerson" width="230" height="173" /><p class="wp-caption-text">photo by Simon Rogerson</p></div>
<p>Some time back, I&#8217;d <a title="TESLA &amp; CUDA" href="http://www.puppetmastertrading.com/blog/2008/11/29/nvidias-tesla-and-the-compute-unified-device-architecture/" target="_blank">written</a> about NVidia&#8217;s CUDA noting that it looked ideal for many asset-pricing and monte-carlo type problems in finance.  At the time, I was hopeful that it would be quickly integrated into existing open source efforts like <a title="QuantLib: a free/open-source library for quantitative finance" href="http://quantlib.org/" target="_blank">QuantLib</a>, but adoption has proved slower than I&#8217;d hoped, most likely because implementing non-trivial problems on CUDA is, well, even less trivial than doing them without..</p>
<p><strong>LMM on CUDA</strong></p>
<p><strong> </strong>Happily, I&#8217;ve just seen a promising first step in this direction as Über-quant and C++ artisan <a title="Mark Joshi" href="http://www.markjoshi.com/" target="_blank">Mark Joshi</a> recently announced an open-source project, <a title="Sourceforge: Kooderive" href="http://sourceforge.net/projects/kooderive/" target="_blank">Kooderive</a> which looks to implement the <a title="Wiki: LMM" href="http://en.wikipedia.org/wiki/LIBOR_market_model" target="_blank">LIBOR Market Model</a> (LMM)  on top of CUDA.  His announcement on the QuantLib mailing lists reads:</p>
<blockquote><p>Dear All,</p>
<p>various people have shown interest in the use of <span id="lw_1265210335_0">CUDA</span> with QuantLib. I<br />
have now made some progress on a CUDA implementation of the <span id="lw_1265210335_1" style="border-bottom: 1px dashed #0066cc; background: transparent none repeat scroll 0% 0%; cursor: pointer;">LIBOR<br />
market model</span>.</p>
<p>In particular, I now have a path generator for the LMM working which<br />
does 16384 paths for 40 rates, 40 steps, 5 factor model, displaced<br />
diffusion predictor-corrector that takes 0.1 seconds on my Quadro 4600.</p>
<p>The state of the project is code fragments that can be called from<br />
other code. Those who are interested can get the code via<br />
the subversion repository on <a href="http://kooderive.sourceforge.net/" target="_blank"><span id="lw_1265210335_2">kooderive.sourceforge.net</span></a> .  The only<br />
project file is currently for VC9 x64. It also uses thrust and the<br />
CUDA SDK.</p>
<p>The next stage will be writing routines, that use QuantLib for the CPU<br />
stuff and kooderive for the GPU stuff,  to actually price things.</p>
<p>A gentle reminder that I will be giving a course on the LMM and<br />
QuantLib in June in <span id="lw_1265210335_3" style="background: transparent none repeat scroll 0% 0%; cursor: pointer;">London</span>, and I will include a session on kooderive<br />
if there<br />
is sufficient interest.</p>
<p>I am happy to take code contributions for kooderive. However, I am not<br />
looking for a redesign of the library or contributions which introduce<br />
dependence on other libraries. I am interested in contributions of<br />
separate routines and of optimizations of existing routines that do<br />
not change interfaces.</p>
<p>regards</p>
<p>Mark<br />
&#8211;<br />
Pricing exotic <span id="lw_1265210335_4" style="border-bottom: 1px dashed #0066cc; background: transparent none repeat scroll 0% 0%; cursor: pointer;">interest rate derivatives</span> &#8211; The <span id="lw_1265210335_5" style="background: transparent none repeat scroll 0% 0%; cursor: pointer;">LIBOR Market Model</span> in<br />
QuantLib <span id="lw_1265210335_6" style="border-bottom: 1px dashed #0066cc; cursor: pointer;">June 2010</span>, London,<br />
<a href="http://www.moneyscience.com/training/index.html" target="_blank"><span id="lw_1265210335_7">http://www.moneyscience.com/training/index.html</span></a></p>
<p>Assoc Prof Mark Joshi<br />
Centre for Actuarial Studies<br />
<span id="lw_1265210335_8">University of Melbourne</span><br />
My website is <a href="http://www.markjoshi.com/" target="_blank"><span id="lw_1265210335_9">www.markjoshi.com</span></a></p></blockquote>
<p><span><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.puppetmastertrading.com/blog/2010/02/03/kooderive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>perfect crime</title>
		<link>http://www.puppetmastertrading.com/blog/2009/11/02/perfect-crime/</link>
		<comments>http://www.puppetmastertrading.com/blog/2009/11/02/perfect-crime/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 12:42:04 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[dereferenced]]></category>
		<category><![CDATA[options pricing]]></category>
		<category><![CDATA[our managed markets]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog/?p=754</guid>
		<description><![CDATA[or: a computational complexity model for derivatives fraud
Derivatives pricing has always been a notoriously complex, computationally expensive and potentially breathtakingly remunerative undertaking.  This is true enough for relatively vanilla, exchange-traded options, but once one goes off-market and starts applying creative financial engineering, it can get much more complicated.  Products like CDOs, CDSs, CDO^2s and their [...]]]></description>
			<content:encoded><![CDATA[<h4><span style="color: #000000;">or: a computational complexity model for derivatives fraud</span></h4>
<div class="wp-caption alignleft" style="width: 196px"><img src="/images/lemon.jpg" alt="lemon law arbitrage?" width="186" height="248" /><p class="wp-caption-text">lemon-law arbitrage?</p></div>
<p>Derivatives pricing has always been a notoriously complex, computationally expensive and potentially breathtakingly remunerative undertaking.  This is true enough for relatively vanilla, exchange-traded options, but once one goes off-market and starts applying creative financial engineering, it can get much more complicated.  Products like CDOs, CDSs, CDO^2s and their ilk have exploded in recent years creating opaque markets of trillions of notional dollars and accounting complexities we&#8217;re still only beginning to understand.</p>
<p>A recent paper, <a title="Computational Complexity and Information Asymmetry in Financial Products" href="http://www.cs.princeton.edu/~rongge/derivative.pdf" target="_blank">Computational Complexity and Information Asymmetry in Financial Products</a>, by Arora, Barak, Brunnermeier and Ge take things a step or two further as they illustrate using information theory that it may be far worse than imagined as <strong><em>totally undetectable fraud</em></strong> <em><strong>can be engineered into these products</strong></em>.  They show that fraud with these products can be undetectable in the sense that the pricing process is a <em>formally</em> <em>intractable</em> problem when the informational asymmetry inherent in the development of these products is taken into consideration. In this context, &#8220;informational asymmetry&#8221; is a polite way of saying &#8220;fraud.&#8221;</p>
<p>The authors, from the Department of Computer Science and Center for Computational Intractability at Princeton (man, I want one of their business cards!), demonstrate that if the designer of, say, a CDO wants to cherry-pick amongst bundled assets to maximize their own return, they can do so in a way such that it would be impossible for a buyer of the derivative to know they were being stiffed.  The problem can be so hard that if you got the NSA&#8217;s mythic clusters humming on a pricing model, they might chug away until the sun falls from the sky before they accurately price it&#8230;  Co-author Rong Ge provides a FAQ to the paper <a title="FAQ" href="http://www.cs.princeton.edu/~rongge/derivativeFAQ.html" target="_blank">here</a> and I must hat-tip Andrew Appel for his <a title="Freedom to Tinker" href="http://www.freedom-to-tinker.com/blog/appel/intractability-financial-derivatives" target="_blank">informative post</a> on the paper.</p>
<p>The &#8220;perfect crime&#8221; is a puzzle that has occupied the (criminal and otherwise) mind of many a bright and motivated soul from time immemorial.  While some may indulge towards the vulgar or base through violence or vice and others might ponder the perfect crime of passion, the cerebral Queen of Crime is surely some form of regulatory arbitrage: committing the crime for which the law has yet to be written or creatively engineering a legal loophole for a crime one has perpetrated or is about to perpetrate.  The developers of CDOs are to be lauded as it appears they have materially upped the state-of-the-art of the perfect crime.</p>
<p>hmmm&#8230; Is there a Nobel for that?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puppetmastertrading.com/blog/2009/11/02/perfect-crime/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NVIDIA&#8217;s TESLA and Compute Unified Device Architecture</title>
		<link>http://www.puppetmastertrading.com/blog/2008/11/29/nvidias-tesla-and-the-compute-unified-device-architecture/</link>
		<comments>http://www.puppetmastertrading.com/blog/2008/11/29/nvidias-tesla-and-the-compute-unified-device-architecture/#comments</comments>
		<pubDate>Sat, 29 Nov 2008 20:42:27 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[monte-carlo methods]]></category>
		<category><![CDATA[options pricing]]></category>
		<category><![CDATA[portfolio management]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog/?p=164</guid>
		<description><![CDATA[ While the war over the latest+greatest video cards for the current generation of graphics intensive games seems always to ebb and flow between nVidia and its arch-rival ATI, I&#8217;ve long preferred nVidia for their better support of Linux.  Thus, all of my machines have some sort of nVidia Graphics Processing Unit (GPU) in them.
For [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" title="NVIDIAs Tesla" src="/images/tesla_logo.jpg" alt="" width="288" height="278" /> While the war over the latest+greatest video cards for the current generation of graphics intensive games seems always to ebb and flow between nVidia and its arch-rival ATI, I&#8217;ve long preferred nVidia for their better support of Linux.  Thus, all of my machines have some sort of nVidia Graphics Processing Unit (GPU) in them.</p>
<p>For those who spend their workdays in the markets and their weekends pondering derivatives pricing, latency, oceans of market data, portfolio optimization, and how to make every last damn thing <em>faster</em>, a preference for nVidia cards could prove to yield an unexpected benefit.</p>
<p>nVidia has recently unveiled a product line dubbed &#8220;TESLA&#8221; which leverages their absurdly fast GPUs to provide a supercomputer-like High Performance Computing (HPC) platform at a previously unimaginable price point.  TESLA computers are regular machines that have a set of slightly modified GPUs in them; modified such that they have no video out, but instead become additive processing clusters which the machine can use for compute intensive tasks.  For about $10K you can buy a 1U machine with some 4 teraflops of capacity.  By way of comparison, this is over 20 times faster than the funky Helmer project I&#8217;d been drooling over a few months <a title="Billions and billions" href="http://www.puppetmastertrading.com/blog/2008/08/22/billions-and-billions/" target="_blank">ago </a>in a production-worthy package ready for the server room today.</p>
<p>So, <a title="Personal Super Computing" href="http://www.nvidia.com/object/personal_supercomputing.html" target="_blank">TESLA</a> refers to the machines built with these specialized GPUs.  Making all this power usable is what <a title="CUDA" href="http://www.nvidia.com/object/cuda_home.html" target="_blank">CUDA</a> is about&#8230;</p>
<p><span id="more-164"></span></p>
<p>CUDA is nVidia&#8217;s model for parallel programming that provides a C-based software environment for the development of applications that take can advantage of nVidia&#8217;s GPU architecture.  These advantages center around parallelism, torrential memory bandwidth and obscene floating point performance.   The below graphs illustrate these advantages against high-end Intel hardware.</p>
<p><img class="aligncenter" title="The advantages" src="/images/cudaPerf.jpg" alt="" width="548" height="830" /></p>
<p>Although I haven&#8217;t yet taken the plunge and purchased one of the trick new TESLA machines, I have been able to dip my toe into the waters as CUDA will work with most newer nVidia cards.  All you need to do is download the CUDA environment and SDK and you can very quickly get up and running.  They have an expansive and well-documented set of examples including many of interest to algorithmic traders &#8211; particularly surrounding derivatives pricing and monte-carlo methods.  I haven&#8217;t tried yet under linux, but was able to successfully modify their sample programs under vista after less than an hour of fiddling.</p>
<p>I had seen some flashes of interest in CUDA on the <a title="Quantlib" href="http://quantlib.org" target="_self">Quantlib</a> mailing lists, but I&#8217;m not sure if there&#8217;s been any real follow-up.  Even if it takes some time for the open source community to get plugged-in, there are already a number of finance-oriented commercial offerings including a plugin to Matlab which allows some operations within Matlab to be offloaded to whatever CUDA subsystems are available.</p>
<p>If you&#8217;re comfortable with C and happen to have an nVidia card handy, I encourage you to take a look-see. The price/performance advantage is remarkable and if you have a problem that can profitably make use of it, one of these boxes might pay for itself in a big hurry!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puppetmastertrading.com/blog/2008/11/29/nvidias-tesla-and-the-compute-unified-device-architecture/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>using Quantlib from Java</title>
		<link>http://www.puppetmastertrading.com/blog/2008/06/14/using-quantlib-from-java/</link>
		<comments>http://www.puppetmastertrading.com/blog/2008/06/14/using-quantlib-from-java/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 04:26:43 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[FIX Protocol]]></category>
		<category><![CDATA[monte-carlo methods]]></category>
		<category><![CDATA[open-source software]]></category>
		<category><![CDATA[options pricing]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog-test/?p=3</guid>
		<description><![CDATA[
One of these days I’m going to give an overview of all the excellent open-source software I use on a daily basis.  Until that day comes, I’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 &#8211; a comprehensive [...]]]></description>
			<content:encoded><![CDATA[<p><img title="A free/open-source library for quantitative finance" src="http://puppetmastertrading.com/images/QL-title.jpg" alt="A free/open-source library for quantitative finance" /></p>
<p>One of these days I’m going to give an overview of all the excellent open-source software I use on a daily basis.  Until that day comes, I’ll observe that finance remains one of the big areas where open-source software has made relatively limited inroads.<img title="Java" src="/images/javabrew.jpg" alt="Java" align="right" /></p>
<p>Two production-quality packages fight that unhappy state: <a title="QuantLib: A free/open-source library for quantitative finance" href="http://quantlib.org" target="_blank">QuantLib</a> &#8211; a comprehensive framework for quantitative finance &#8211; and <a title="QuickFix: Open-source FIX engine" href="http://www.quickfixengine.org/" target="_blank">QuickFix</a> &#8211; a full-featured <a title="Financial Information eXchange" href="http://fixprotocol.org" target="_blank">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’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’m not really a windows developer and don’t have all the shiny tools that windows developers use, so it’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" href="http://www.mingw.org/" target="_blank">MinGW+MSYS</a> but it wasn’t terribly easy and I don’t currently have a working installation, so I won’t cover that here.  If this is your aim, don’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
<ul>
<li>Requires a working version of <a title="Boost C++ Library" href="http://www.boost.org/" target="_blank">Boost</a>.   This may prove to be the hardest step of all and you’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></p>
<p><code>make</code><br />
<code>sudo make install</code></ul>
</li>
<li>Build QuantLib-SWIG
<ul>
<li>Requires a working copy of <a title="SWIG - Simplified Wrapper and Interface Generator" href="http://www.swig.org/" target="_blank">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 \</code></p>
<p>&#8211;with-jdk-include=${JAVA_HOME}/include \<br />
&#8211;with-jdk-system-include=${JAVA_HOME}/include/linux<br />
<code>make -C Java</code><br />
<code>sudo make install</code></ul>
</li>
</ul>
<ul>
<li>Now you’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’s it.  Now test your configuration by running the examples in Quantlib-SWIG/Java/examples.</li>
</ul>
<p>It’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’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’t exposed in those files, you may need to expose it yourself.</p>
<p>There’s a learning curve, but it’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://www.puppetmastertrading.com/blog/2008/06/14/using-quantlib-from-java/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>laughter in the dark</title>
		<link>http://www.puppetmastertrading.com/blog/2008/02/26/laughter-in-the-dark/</link>
		<comments>http://www.puppetmastertrading.com/blog/2008/02/26/laughter-in-the-dark/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 13:56:45 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[dereferenced]]></category>
		<category><![CDATA[options pricing]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog-test/?p=44</guid>
		<description><![CDATA[
Professor DeLong  points out that Emanuel Derman has begun posting lecture notes to classes he&#8217;s teaching as part of the Columbia Master&#8217;s of Financial Engineering.   If you&#8217;re even remotely interested in financial engineering or algorithmic trading, then you should read Dr. Derman&#8217;s engrossing book &#8220;My Life as a Quant&#8221; as it gives [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.ederman.com/new/docs/laughter.html"><img title="Lips (Heure de l'Observatoire) - Man Ray" alt="Lips (Heure de l'Observatoire) - Man Ray" src="http://puppetmastertrading.com/images/manray.jpg" /></a></p>
<p>Professor DeLong  <a title="Brad DeLong's Semi-Daily Journal" target="_blank" href="http://delong.typepad.com/sdj/2008/02/introduction-to.html">points out</a> that <a target="_blank" title="Emanuel Derman's blog" href="http://www.wilmott.com/blogs/eman/">Emanuel Derman</a> has begun posting <a title="Lecture notes from Columbia Master's in Financial Engineering" target="_blank" href="http://www.ederman.com/new/docs/laughter.html">lecture notes</a> to classes he&#8217;s teaching as part of the Columbia <a title="Columbia Master's of Financial Engineering" target="_blank" href="http://www.ieor.columbia.edu/pages/graduate/ms_financial_eng/index.html">Master&#8217;s of Financial Engineering</a>.   If you&#8217;re even remotely interested in financial engineering or algorithmic trading, then you should read Dr. Derman&#8217;s engrossing book <a target="_blank" title="His life as a quant" href="http://www.amazon.com/My-Life-Quant-Reflections-Physics/dp/0470192739/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1204053905&#038;sr=8-1">&#8220;My Life as a Quant&#8221;</a> as it gives a unique and personal perspective on the explosion of engineering as a discipline within finance.  I haven&#8217;t studied his notes carefully yet but a cursory examination suggests they look very worthwhile.</p>
<p>I recently found in my inbox an invitation to study for a <a target="_blank" title="CQF" href="http://www.7city.com/cqf.php?area=quants&#038;outline=cqf&#038;course=cqf">Certificate in Quantitative Finance</a> which is, I&#8217;m sure, a great program.  But it&#8217;s pretty pricey and any quant should be aware of costs!  Laughing in the dark might be a reasonable alternative to shelling out for a more structured offering&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puppetmastertrading.com/blog/2008/02/26/laughter-in-the-dark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>multiverse</title>
		<link>http://www.puppetmastertrading.com/blog/2007/10/18/multiverse/</link>
		<comments>http://www.puppetmastertrading.com/blog/2007/10/18/multiverse/#comments</comments>
		<pubDate>Thu, 18 Oct 2007 13:44:55 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[EMS Internals]]></category>
		<category><![CDATA[back-testing]]></category>
		<category><![CDATA[options pricing]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog-test/?p=34</guid>
		<description><![CDATA[
There are many conceptions of our world and its underlying nature, each seemingly more creative than the last.  One of my favorites &#8211; adopted by all serious fans of Star Trek as well as some physicists who&#8217;ve run rather far afoul of friar Occam&#8217;s good rule - posits the existence of a multiverse.  [...]]]></description>
			<content:encoded><![CDATA[<p><img align="left" title="turtles all the way down" alt="turtles all the way down" src="http://puppetmastertrading.com/blog/images/reality_turtles.gif" /></p>
<p>There are many conceptions of our world and its underlying nature, each seemingly <a title="turtles all the way down" target="_blank" href="http://en.wikipedia.org/wiki/Turtles_all_the_way_down">more creative </a>than the <a title="standard, indeed" target="_blank" href="http://www.symmetrymagazine.org/images/200502/standard3.gif">last</a>.  One of my favorites &#8211; adopted by all serious fans of Star Trek as well as some physicists who&#8217;ve run rather far afoul of friar Occam&#8217;s good <a title="lex parsimoniae" target="_blank" href="http://en.wikipedia.org/wiki/Occam%27s_razor">rule </a>- posits the existence of a <a title="multiverse" target="_blank" href="http://en.wikipedia.org/wiki/Multiverse">multiverse</a>.  There are various such stories, but the basic idea is that at every quanta in time the universe partitions itself off into an infinitude of parallel instances of itself, each representing a different branch of realized possibilities.  In this one, I decided to become a surfer while in that one I went into finance and in that one I led the US to its first-ever world cup <a target="_blank" title="Current Champions" href="http://www.telegraph.co.uk/news/graphics/2006/07/14/wcup14.jpg">victory</a>. While we only experience the particular universe we happen to be situated in, the multiverse represents the simultaneous execution of all possible universes.  Under this view, we really do live in <a target="_blank" title="and the worst, too" href="http://en.wikipedia.org/wiki/Gottfried_Leibniz#Theodicy_and_optimism">the best of all possible worlds</a>.</p>
<p>This idea has surprising utility.  While its cosmological implications might represent the extreme psychedelic fringe of the continuum, at the other ends lies actuarial science, the foundations of risk management and, yes, a variety of option pricing techniques.</p>
<p><span id="more-34"></span></p>
<p>In the universe of the simplified algorithmic trader we&#8217;ve been discussing, there are at least three ways in which this unfolding of possibilities can be considered.  In the first case, we can vary the decision-making of the strategy itself; in the second, we can vary the market conditions upon which the strategy will base its decision-making and in the third case we can vary both.  They are all forms of <strong>scenario analysis</strong>.</p>
<p>When we talk about varying the decision-making of the strategy itself, there&#8217;s a range of possible adjustments we might make.  We could be speaking of actually swapping out the entire strategy itself &#8211; eg, going from a trend-following to a mean-reverting strategy.  Or we could talk about changing characteristics of a given strategy.  For example, to reuse our <a title="morning range breakout" href="http://puppetmastertrading.com/blog/2007/09/26/sucker-punch-an-example/">first simple sample strategy</a> &#8211; the morning range breakout &#8211; we had a few natural &#8220;levers&#8221; or <strong>parameters </strong>which we could modify about the strategy without fundamentally changing its underlying behavior.  That strategy exposed two such parameters: what to trade and how long to wait before putting its trades onto the market (that is, the length of the morning range).</p>
<p>If we take this idea of permuting a strategy by way of its parameters and combine it with the idea we discussed last time and back test each of these permutations, we arrive very close to the idea of <strong>parameter optimization</strong> of a strategy.  The only missing piece is the idea of ranking the results of each of these strategies.  This turns out to be somewhat more complicated than it might appear and we&#8217;ll consider it in a later post.</p>
<p>Assuming a simple case where we disregard risk management practices and simply rank the strategies by return on investment (ROI), we can see that parameter optimization is a bit of a misnomer as we&#8217;re not so much optimizing the strategy as we are searching for the best strategy within a set of strategies defined by the ranges of each of the parameters we&#8217;re considering.  This is at best a weak form of optimization and is perhaps better characterized as a search problem.</p>
<p>Before considering the utility and limitations of this kind of parameter optimization we&#8217;ll next take a look at the second form of scenario analysis in which instead of permuting the strategy by way of its parameters, we change the market conditions in which the strategy operates.  This will be the topic of our next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puppetmastertrading.com/blog/2007/10/18/multiverse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A trading strategy is an option</title>
		<link>http://www.puppetmastertrading.com/blog/2007/10/10/a-trading-strategy-is-an-option/</link>
		<comments>http://www.puppetmastertrading.com/blog/2007/10/10/a-trading-strategy-is-an-option/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 13:34:36 +0000</pubDate>
		<dc:creator>tito</dc:creator>
				<category><![CDATA[back-testing]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[monte-carlo methods]]></category>
		<category><![CDATA[open-source software]]></category>
		<category><![CDATA[options pricing]]></category>
		<category><![CDATA[performance analysis]]></category>
		<category><![CDATA[strategy development]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://www.puppetmastertrading.com/blog-test/?p=27</guid>
		<description><![CDATA[
The best way to reason about a trading strategy&#8217;s performance, that is valuing it, is as an option.
Or perhaps as a collection or portfolio of them.
I have to assume that people reading this have a working idea of what an option is, so I&#8217;m not going to provide definitions that can be readily found elsewhere. [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="options, options, ..." title="options, options, ..." src="http://puppetmastertrading.com/blog/images/oneway.jpg" /></p>
<p>The best way to reason about a trading strategy&#8217;s <em>performance</em>, that is <strong><em>valuing</em></strong> it, is as an option.</p>
<p>Or perhaps as a collection or portfolio of them.</p>
<p>I have to assume that people reading this have a working idea of what an option is, so I&#8217;m not going to provide definitions that can be readily found <a target="_blank" title="option definition" href="http://en.wikipedia.org/wiki/Option_%28finance%29">elsewhere.</a> I will note that my favorite book on the trading of options is by <a target="_blank" title="Option Market Making" href="http://www.amazon.com/Option-Market-Making-Financial-Commodity/dp/0471578320/ref=pd_bbs_sr_4/102-4760953-2767316?ie=UTF8&#038;s=books&#038;qid=1192021949&#038;sr=8-4">Allen Jan Baird.</a></p>
<p>Let&#8217;s consider the three illustrative trading strategies we&#8217;ve looked at up until now.  The trend-following strategy suffered many little losses and then enjoyed a big win.  Sounds like buying options. The mean-reverting strategy made lots of little profits and then risked getting clobbered with a big loss.  Sounds like someone who&#8217;s writing options.  And the first strategy we <a title="morning range breakout" href="http://puppetmastertrading.com/blog/2007/10/02/anatomy-of-a-knockout/">looked at</a>, the morning range breakout, had a payoff which looked like a long straddle or strangle where the break-evens were near the observed high and lows for the session (where we set our entry stops).</p>
<p><img title="straddle payoff" alt="straddle payoff" src="http://puppetmastertrading.com/blog/images/straddle.gif" /></p>
<p>Now, there&#8217;s obvious differences between the trading strategies&#8217; payoff structures as compared to the similar options strategies.  There&#8217;s no premium, for instance, and that&#8217;s clearly significant.  The morning range breakout seems to exhibit a sort of knockout effect when a position has been entered but then the market reverses and you&#8217;re &#8220;knocked-out&#8221; of your position.  You just take a loss and do not collect even if the market turns back in your direction.  With a straddle you don&#8217;t have this behavior.  There are differences and they are worth keeping in mind.  But the reasons for viewing trading strategies as options portfolios are many and compelling.</p>
<p>The superficial reason, as I mentioned, is that the basic payout structures are potentially similar.  The deep reason is that ultimately the problems are the same &#8211; how to value complex instruments with engineered payouts.  And the pragmatic reason is that many many very smart people have applied their considerable brains and diverse skill-sets to advancing options pricing techniques.  There&#8217;s also a great deal of high quality software available <a target="_blank" title="QuantLib" href="http://www.quantlib.org">out there</a> which can be used to adapt these time-proven techniques to your own algorithmic trading strategy valuations.</p>
<p>The techniques which we&#8217;ve seen up until now, back-testing and parameter optimization, are sort of  weak cousins of a family of techniques long used for options pricing: Monte-Carlo (MC) methods.  MC simulation can clearly be used to assess a trading strategy&#8217;s performance.</p>
<p>In subsequent posts, we&#8217;ll talk about some of the details of each of these techniques and about some of their respective trade-offs.  That should keep my pump primed for a bit, but in the meanwhile I leave you with a parting inquiry: what other options pricing techniques might we apply to our algorithmic trading practices?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.puppetmastertrading.com/blog/2007/10/10/a-trading-strategy-is-an-option/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
