<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Calculating peak-to-trough drawdown</title>
	<atom:link href="http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 14:27:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Adam</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-45050</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Wed, 01 Feb 2012 14:27:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-45050</guid>
		<description>Just stumbled on this but I wanted to share my solution:
&lt;pre&gt;&lt;code&gt;
def bad(list):
    maxi = 0
    mini = 0
    loss = 0
    maxLoss = 0
    for i, x in enumerate(list):
        maxi = max(x, maxi)
        mini = min(list[i:])
        loss = maxi - mini
        maxLoss = max(maxLoss,loss)
    return maxLoss
&lt;/code&gt;&lt;/pre&gt;
This walks through the list, updating the maximum point it has been through, and comparingit to the minimum from the remaining list, calculating a maximum loss at every step through the list. The maxLoss also updates to be the biggest value yet reached as the walk continues.</description>
		<content:encoded><![CDATA[<p>Just stumbled on this but I wanted to share my solution:</p>
<pre><code>
def bad(list):
    maxi = 0
    mini = 0
    loss = 0
    maxLoss = 0
    for i, x in enumerate(list):
        maxi = max(x, maxi)
        mini = min(list[i:])
        loss = maxi - mini
        maxLoss = max(maxLoss,loss)
    return maxLoss
</code></pre>
<p>This walks through the list, updating the maximum point it has been through, and comparingit to the minimum from the remaining list, calculating a maximum loss at every step through the list. The maxLoss also updates to be the biggest value yet reached as the walk continues.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Knight</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-37117</link>
		<dc:creator>Steve Knight</dc:creator>
		<pubDate>Mon, 18 Jul 2011 10:45:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-37117</guid>
		<description>&lt;strong&gt;Gonz&lt;/strong&gt; Thanks for your comment.   Yes, I agree it&#039;s not the greatest of measures.    But it does appear quite a lot in hedge-fund prospectuses and the meaning I&#039;ve given is the one that investors expect.   Whether they place any weight behind it is another matter!</description>
		<content:encoded><![CDATA[<p><strong>Gonz</strong> Thanks for your comment.   Yes, I agree it&#8217;s not the greatest of measures.    But it does appear quite a lot in hedge-fund prospectuses and the meaning I&#8217;ve given is the one that investors expect.   Whether they place any weight behind it is another matter!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gonz</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-37115</link>
		<dc:creator>Gonz</dc:creator>
		<pubDate>Mon, 18 Jul 2011 07:27:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-37115</guid>
		<description>Hmmm, this is interesting but I&#039;m not sure imposing temporal order on the data will satisfy your investors requirements. I would think most investors want to know what could be not what would have been if they had have done something (bought x time ago) that they didn&#039;t actually do. In that case it becomes a question of variability regardless of temporal order. As you point out assumptions of historical prices (and events surrounding them) repeating over time is not all that sound but if the assumption is made (eg the highest high could happen again) then I would have thought the biggest difference looking at all the trends (either high to low or low to high remember we&#039;re assuming rightly or wrongly the highs and lows are repeatable so if something has been so low before it can/will be again)is the worst case scenario.</description>
		<content:encoded><![CDATA[<p>Hmmm, this is interesting but I&#8217;m not sure imposing temporal order on the data will satisfy your investors requirements. I would think most investors want to know what could be not what would have been if they had have done something (bought x time ago) that they didn&#8217;t actually do. In that case it becomes a question of variability regardless of temporal order. As you point out assumptions of historical prices (and events surrounding them) repeating over time is not all that sound but if the assumption is made (eg the highest high could happen again) then I would have thought the biggest difference looking at all the trends (either high to low or low to high remember we&#8217;re assuming rightly or wrongly the highs and lows are repeatable so if something has been so low before it can/will be again)is the worst case scenario.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jogster</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-34853</link>
		<dc:creator>Jogster</dc:creator>
		<pubDate>Fri, 22 Apr 2011 21:40:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-34853</guid>
		<description>Great article, as you say its the edge case that are difficult.</description>
		<content:encoded><![CDATA[<p>Great article, as you say its the edge case that are difficult.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Knight</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-34791</link>
		<dc:creator>Steve Knight</dc:creator>
		<pubDate>Wed, 20 Apr 2011 19:14:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-34791</guid>
		<description>Hi Chris,

Yes, that&#039;s easier, but this is not peak-to-trough draw-down as I defined it.   This procedure will find the largest price difference.    

To appreciate the difference, consider what would happen if the minimum value is &lt;b&gt;before&lt;/b&gt; the highest point.    This is not draw-down because an investor could never &#039;experience&#039; this loss.

Once you bear this in mind you will realise that the peak-to-trough may not actually involve the highest point in the series at-all.   Any local maximum can be the highest point as long as it&#039;s followed by a local minimum that is low enough.

Hope that helps

Steve</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>Yes, that&#8217;s easier, but this is not peak-to-trough draw-down as I defined it.   This procedure will find the largest price difference.    </p>
<p>To appreciate the difference, consider what would happen if the minimum value is <b>before</b> the highest point.    This is not draw-down because an investor could never &#8216;experience&#8217; this loss.</p>
<p>Once you bear this in mind you will realise that the peak-to-trough may not actually involve the highest point in the series at-all.   Any local maximum can be the highest point as long as it&#8217;s followed by a local minimum that is low enough.</p>
<p>Hope that helps</p>
<p>Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: crew</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-34477</link>
		<dc:creator>crew</dc:creator>
		<pubDate>Fri, 08 Apr 2011 20:26:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-34477</guid>
		<description>It is not nearly that complicated, it can also be done in excel in seconds.
Step 1) Take first data point set as high
Step 2) run if statement that if n+1 data point is &gt; than n data point, n+1 data point is new high
Step 3) take [(n / step 2) - 1] this gives you your % drawdown
Step 4) take the minimum value achieved from Step 3</description>
		<content:encoded><![CDATA[<p>It is not nearly that complicated, it can also be done in excel in seconds.<br />
Step 1) Take first data point set as high<br />
Step 2) run if statement that if n+1 data point is &gt; than n data point, n+1 data point is new high<br />
Step 3) take [(n / step 2) - 1] this gives you your % drawdown<br />
Step 4) take the minimum value achieved from Step 3</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Knight</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-31220</link>
		<dc:creator>Steve Knight</dc:creator>
		<pubDate>Wed, 06 Oct 2010 11:54:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-31220</guid>
		<description>Hi Andy,

Well the peak-to-trough draw-down is a metric that might tell an investor what&#039;s the absolute worst-case loss ever seen historically.   Therefore I would always expect the peak to happen before the trough, therefore a trailing peak should have no effect on the result.

Hope that helps,

Steve</description>
		<content:encoded><![CDATA[<p>Hi Andy,</p>
<p>Well the peak-to-trough draw-down is a metric that might tell an investor what&#8217;s the absolute worst-case loss ever seen historically.   Therefore I would always expect the peak to happen before the trough, therefore a trailing peak should have no effect on the result.</p>
<p>Hope that helps,</p>
<p>Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-31050</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Sun, 26 Sep 2010 04:46:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-31050</guid>
		<description>Working on max drawdown problem and came across a case that I&#039;m baffled with.  If your data set has a peak value occuring on the very last value then you will have to trough value would the drawdown be 0 or would you use the previous peak/trough values which your solution provides ?

Thanks
Andy</description>
		<content:encoded><![CDATA[<p>Working on max drawdown problem and came across a case that I&#8217;m baffled with.  If your data set has a peak value occuring on the very last value then you will have to trough value would the drawdown be 0 or would you use the previous peak/trough values which your solution provides ?</p>
<p>Thanks<br />
Andy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-979</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 04 Oct 2007 08:55:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-979</guid>
		<description>Ahh yes, I noticed this about a day after my initial posting. I see now the complexity..

D&#039;oh!</description>
		<content:encoded><![CDATA[<p>Ahh yes, I noticed this about a day after my initial posting. I see now the complexity..</p>
<p>D&#8217;oh!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Knight</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-947</link>
		<dc:creator>Steve Knight</dc:creator>
		<pubDate>Tue, 02 Oct 2007 13:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-947</guid>
		<description>Hi Chris,

Yes, what you&#039;ve posted kind-of makes the point for me that this problem is harder than it looks.   With your solution you&#039;ll find that if the low comes before the high you&#039;ll be showing a peak-to-trough that could never have occurred.   In this case you&#039;ll be showing the trough-to-peak gain!   Which investors care about too but not for this measure.

Steve</description>
		<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>Yes, what you&#8217;ve posted kind-of makes the point for me that this problem is harder than it looks.   With your solution you&#8217;ll find that if the low comes before the high you&#8217;ll be showing a peak-to-trough that could never have occurred.   In this case you&#8217;ll be showing the trough-to-peak gain!   Which investors care about too but not for this measure.</p>
<p>Steve</p>
]]></content:encoded>
	</item>
</channel>
</rss>

