<?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>Tue, 20 Jul 2010 09:51:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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>
	<item>
		<title>By: Chris</title>
		<link>http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown/comment-page-1#comment-931</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Mon, 01 Oct 2007 07:33:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.hackinghat.com/index.php/python/calculating-peak-to-trough-drawdown#comment-931</guid>
		<description>Hi Steve,

(Apologies if this is a repost - it hasn&#039;t popped up yet, so having to retype)... The second solution - isn&#039;t it a case of two if&#039;s?

My python is pretty weak (har har), but if I&#039;ve translated correctly into C#, doesn&#039;t the below code do the same, but in a simpler fashion?

&lt;pre&gt;&lt;code&gt;
        public static double DrawDown( double[] prices, out double minValue, out double maxValue )
        {
            maxValue = double.MinValue;
            minValue = double.MaxValue;

            for( int i = 0; i &lt; prices.Length; i++ )
            {
                if( prices[i] &gt; maxValue )
                    maxValue = prices[i];
                if( prices[i] &lt; minValue )
                    minValue = prices[i];
            }
            return maxValue - minValue;
        }
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi Steve,</p>
<p>(Apologies if this is a repost &#8211; it hasn&#8217;t popped up yet, so having to retype)&#8230; The second solution &#8211; isn&#8217;t it a case of two if&#8217;s?</p>
<p>My python is pretty weak (har har), but if I&#8217;ve translated correctly into C#, doesn&#8217;t the below code do the same, but in a simpler fashion?</p>
<pre><code>
        public static double DrawDown( double[] prices, out double minValue, out double maxValue )
        {
            maxValue = double.MinValue;
            minValue = double.MaxValue;

            for( int i = 0; i < prices.Length; i++ )
            {
                if( prices[i] > maxValue )
                    maxValue = prices[i];
                if( prices[i] < minValue )
                    minValue = prices[i];
            }
            return maxValue - minValue;
        }
</code></code></pre>
]]></content:encoded>
	</item>
</channel>
</rss>
