<?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: Get Rich Slowly	</title>
	<atom:link href="https://financial-hacker.com/get-rich-slowly/feed/" rel="self" type="application/rss+xml" />
	<link>https://financial-hacker.com/get-rich-slowly/</link>
	<description>A new view on algorithmic trading</description>
	<lastBuildDate>Thu, 28 Apr 2022 17:16:16 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: HB		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-79648</link>

		<dc:creator><![CDATA[HB]]></dc:creator>
		<pubDate>Thu, 28 Apr 2022 17:16:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-79648</guid>

					<description><![CDATA[I had trouble getting the code to work for the plotHeatmap in the &quot;Selecting the Assets&quot; section.  Using Zorro 2.40.

Got it to work by adding 

    #include  

at the top.

Also changed the second to last line from 

   100*annual(Moment(Returns[i],LookBack,1)),

to 

   252*100*Moment(Returns[i],LookBack,1),
   
Just passing this along in case any one else is stuck.]]></description>
			<content:encoded><![CDATA[<p>I had trouble getting the code to work for the plotHeatmap in the &#8220;Selecting the Assets&#8221; section.  Using Zorro 2.40.</p>
<p>Got it to work by adding </p>
<p>    #include  </p>
<p>at the top.</p>
<p>Also changed the second to last line from </p>
<p>   100*annual(Moment(Returns[i],LookBack,1)),</p>
<p>to </p>
<p>   252*100*Moment(Returns[i],LookBack,1),</p>
<p>Just passing this along in case any one else is stuck.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jcl		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-67871</link>

		<dc:creator><![CDATA[jcl]]></dc:creator>
		<pubDate>Sun, 08 Nov 2020 08:52:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-67871</guid>

					<description><![CDATA[Yes, Covariances[i][j] would also work. But it is a bit slower, because [N*i+j] stores all values at the begin of the array, which is more cache effective. And it also works with dynamic arrays, while [i][j] would not.

This is just from my game programming background. We game programmers use always one-dimensional arrays and always address them with [N*i+j] for gaining a few microseconds. But speed does not matter much for this system, so you can also use the conventional [i][j] addressing if you want.]]></description>
			<content:encoded><![CDATA[<p>Yes, Covariances[i][j] would also work. But it is a bit slower, because [N*i+j] stores all values at the begin of the array, which is more cache effective. And it also works with dynamic arrays, while [i][j] would not.</p>
<p>This is just from my game programming background. We game programmers use always one-dimensional arrays and always address them with [N*i+j] for gaining a few microseconds. But speed does not matter much for this system, so you can also use the conventional [i][j] addressing if you want.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: CLearner		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-67847</link>

		<dc:creator><![CDATA[CLearner]]></dc:creator>
		<pubDate>Sat, 07 Nov 2020 09:45:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-67847</guid>

					<description><![CDATA[JCL, would you be so kind to explain one line of code in the final script for a beginner?

Covariances[N*i+j] = Covariance(Returns[i],Returns[j],LookBack);

Why N*i+j? We declared Covariances[NN][NN] (NN defined 30) as two-dimensional array and here we use only one dimension and with strange math as Covariances[6*6+6].

Thank you in advance]]></description>
			<content:encoded><![CDATA[<p>JCL, would you be so kind to explain one line of code in the final script for a beginner?</p>
<p>Covariances[N*i+j] = Covariance(Returns[i],Returns[j],LookBack);</p>
<p>Why N*i+j? We declared Covariances[NN][NN] (NN defined 30) as two-dimensional array and here we use only one dimension and with strange math as Covariances[6*6+6].</p>
<p>Thank you in advance</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Andrew Dolder		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-64731</link>

		<dc:creator><![CDATA[Andrew Dolder]]></dc:creator>
		<pubDate>Sun, 03 May 2020 23:58:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-64731</guid>

					<description><![CDATA[Johann,

I ran some tests, and I have some observations:

1) In terms of profits, your original simple average formula tended to be more profitable, per the modified MVOTest script.
2) The deviation of Geometric Means tend to be large when variance is large. I modified the Heatmap script, and here&#039;s the log output (five years of lookback):

1 - TLT: GeoMean 8.58%  Mean 9.68%  Variance 2.01%  M/GM = 1.1216
2 - LQD: GeoMean 4.87%  Mean 5.26%  Variance 0.73%  M/GM = 1.0762
3 - SPY: GeoMean 8.45%  Mean 10.35%  Variance 3.45%  M/GM = 1.2141
4 - GLD: GeoMean 7.08%  Mean 8.04%  Variance 1.78%  M/GM = 1.1295
5 - VGLT: GeoMean 8.44%  Mean 9.39%  Variance 1.74%  M/GM = 1.1072
6 - AOK: GeoMean 3.67%  Mean 3.86%  Variance 0.38%  M/GM = 1.0526

In the right column, I checked to see how much larger the mean was than the geometric mean.

OK, one more, but with one year of lookback:

1 - TLT: GeoMean 39.01%  Mean 42.29%  Variance 4.71%  M/GM = 1.0710
2 - LQD: GeoMean 11.96%  Mean 13.52%  Variance 2.79%  M/GM = 1.1223
3 - SPY: GeoMean -0.87%  Mean 4.19%  Variance 9.90%  M/GM = -4.7005
4 - GLD: GeoMean 33.22%  Mean 35.16%  Variance 2.91%  M/GM = 1.0504
5 - VGLT: GeoMean 38.18%  Mean 40.92%  Variance 3.97%  M/GM = 1.0609
6 - AOK: GeoMean 3.50%  Mean 4.05%  Variance 1.07%  M/GM = 1.1556

Here, you can see a huge discrepancy between SPY&#039;s geometric mean and simple mean.  Also, TLT and VGLT were wildly profitable in lookback, so their means were somewhat close together despite high volatility.

I have a hypothesis that your script is more aggressive/&quot;fearless&quot; than mine (more emphasis on volatile assets), and it&#039;s somehow reaping extra profit from it.

At this point, I&#039;m mostly curious to know how the resulting sharpe ratios compare.  Perhaps the geometric equity curves are less volatile? More research required.

For your reference, here&#039;s the geometric average function:

// Geometric Average of Returns.  
// Data input: relative returns, e.g. 0.12 for 12% return, -0.054 for -5.4% return, etc.
// len: Number of elements to be averaged.
var GeometricAvg(vars Data, int len){
	len = max(1,len);
	int i;
	var scaleup = 1;
	for(i=0;i&#060;len;i++){
		scaleup *= Data[i] + 1;
	}
	return pow(scaleup,((var)1)/len)-1;
}]]></description>
			<content:encoded><![CDATA[<p>Johann,</p>
<p>I ran some tests, and I have some observations:</p>
<p>1) In terms of profits, your original simple average formula tended to be more profitable, per the modified MVOTest script.<br />
2) The deviation of Geometric Means tend to be large when variance is large. I modified the Heatmap script, and here&#8217;s the log output (five years of lookback):</p>
<p>1 &#8211; TLT: GeoMean 8.58%  Mean 9.68%  Variance 2.01%  M/GM = 1.1216<br />
2 &#8211; LQD: GeoMean 4.87%  Mean 5.26%  Variance 0.73%  M/GM = 1.0762<br />
3 &#8211; SPY: GeoMean 8.45%  Mean 10.35%  Variance 3.45%  M/GM = 1.2141<br />
4 &#8211; GLD: GeoMean 7.08%  Mean 8.04%  Variance 1.78%  M/GM = 1.1295<br />
5 &#8211; VGLT: GeoMean 8.44%  Mean 9.39%  Variance 1.74%  M/GM = 1.1072<br />
6 &#8211; AOK: GeoMean 3.67%  Mean 3.86%  Variance 0.38%  M/GM = 1.0526</p>
<p>In the right column, I checked to see how much larger the mean was than the geometric mean.</p>
<p>OK, one more, but with one year of lookback:</p>
<p>1 &#8211; TLT: GeoMean 39.01%  Mean 42.29%  Variance 4.71%  M/GM = 1.0710<br />
2 &#8211; LQD: GeoMean 11.96%  Mean 13.52%  Variance 2.79%  M/GM = 1.1223<br />
3 &#8211; SPY: GeoMean -0.87%  Mean 4.19%  Variance 9.90%  M/GM = -4.7005<br />
4 &#8211; GLD: GeoMean 33.22%  Mean 35.16%  Variance 2.91%  M/GM = 1.0504<br />
5 &#8211; VGLT: GeoMean 38.18%  Mean 40.92%  Variance 3.97%  M/GM = 1.0609<br />
6 &#8211; AOK: GeoMean 3.50%  Mean 4.05%  Variance 1.07%  M/GM = 1.1556</p>
<p>Here, you can see a huge discrepancy between SPY&#8217;s geometric mean and simple mean.  Also, TLT and VGLT were wildly profitable in lookback, so their means were somewhat close together despite high volatility.</p>
<p>I have a hypothesis that your script is more aggressive/&#8221;fearless&#8221; than mine (more emphasis on volatile assets), and it&#8217;s somehow reaping extra profit from it.</p>
<p>At this point, I&#8217;m mostly curious to know how the resulting sharpe ratios compare.  Perhaps the geometric equity curves are less volatile? More research required.</p>
<p>For your reference, here&#8217;s the geometric average function:</p>
<p>// Geometric Average of Returns.<br />
// Data input: relative returns, e.g. 0.12 for 12% return, -0.054 for -5.4% return, etc.<br />
// len: Number of elements to be averaged.<br />
var GeometricAvg(vars Data, int len){<br />
	len = max(1,len);<br />
	int i;<br />
	var scaleup = 1;<br />
	for(i=0;i&lt;len;i++){<br />
		scaleup *= Data[i] + 1;<br />
	}<br />
	return pow(scaleup,((var)1)/len)-1;<br />
}</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jcl		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-64716</link>

		<dc:creator><![CDATA[jcl]]></dc:creator>
		<pubDate>Sun, 03 May 2020 11:53:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-64716</guid>

					<description><![CDATA[You&#039;re right, a geometric average would be better than the mean, especially when assets have extreme volatility. I used the mean simply because anyone used it for MVO -  after all it&#039;s named Mean-Variance Optimization. Try the geometric average, maybe this will improve the performance.]]></description>
			<content:encoded><![CDATA[<p>You&#8217;re right, a geometric average would be better than the mean, especially when assets have extreme volatility. I used the mean simply because anyone used it for MVO &#8211;  after all it&#8217;s named Mean-Variance Optimization. Try the geometric average, maybe this will improve the performance.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Andrew Dolder		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-64667</link>

		<dc:creator><![CDATA[Andrew Dolder]]></dc:creator>
		<pubDate>Fri, 01 May 2020 11:39:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-64667</guid>

					<description><![CDATA[I made a math error in my last comment - total return was -73%, but the geometric average of returns is -27.9%. If you return -27.9% four times, your total return is -73%.]]></description>
			<content:encoded><![CDATA[<p>I made a math error in my last comment &#8211; total return was -73%, but the geometric average of returns is -27.9%. If you return -27.9% four times, your total return is -73%.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Andrew Dolder		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-64666</link>

		<dc:creator><![CDATA[Andrew Dolder]]></dc:creator>
		<pubDate>Fri, 01 May 2020 11:27:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-64666</guid>

					<description><![CDATA[Johann,

I see that you are using the first moment to evaluate average returns. If I&#039;m not mistaken, this is a simple average.

Wouldn&#039;t a geometric average of returns be more appropriate here?

An extreme example: An asset returns +200%, +200%, -99%, and 200%.  A simple average will calculate an amazing return of 125%, whereas a geometric average calculates a -73% return.

It seems that simple average of returns will tend to overrate volatile assets, whereas a geometric average return will always better reflect actual returns of the sample period.]]></description>
			<content:encoded><![CDATA[<p>Johann,</p>
<p>I see that you are using the first moment to evaluate average returns. If I&#8217;m not mistaken, this is a simple average.</p>
<p>Wouldn&#8217;t a geometric average of returns be more appropriate here?</p>
<p>An extreme example: An asset returns +200%, +200%, -99%, and 200%.  A simple average will calculate an amazing return of 125%, whereas a geometric average calculates a -73% return.</p>
<p>It seems that simple average of returns will tend to overrate volatile assets, whereas a geometric average return will always better reflect actual returns of the sample period.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: jcl		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-32944</link>

		<dc:creator><![CDATA[jcl]]></dc:creator>
		<pubDate>Wed, 16 May 2018 08:06:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-32944</guid>

					<description><![CDATA[You mean the portfolio with the 3 stocks? It&#039;s from Markowitz&#039; book.]]></description>
			<content:encoded><![CDATA[<p>You mean the portfolio with the 3 stocks? It&#8217;s from Markowitz&#8217; book.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Henok		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-32935</link>

		<dc:creator><![CDATA[Henok]]></dc:creator>
		<pubDate>Wed, 16 May 2018 06:24:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-32935</guid>

					<description><![CDATA[hi could you may be tell us the source for the Markowitz&#039;s example portfolio? Nice one though]]></description>
			<content:encoded><![CDATA[<p>hi could you may be tell us the source for the Markowitz&#8217;s example portfolio? Nice one though</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Get Rich Slowly – The Financial Hacker &#124; Samuelssons Rapport		</title>
		<link>https://financial-hacker.com/get-rich-slowly/#comment-31548</link>

		<dc:creator><![CDATA[Get Rich Slowly – The Financial Hacker &#124; Samuelssons Rapport]]></dc:creator>
		<pubDate>Fri, 11 May 2018 15:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.financial-hacker.com/?p=1702#comment-31548</guid>

					<description><![CDATA[[&#8230;] Källa: Get Rich Slowly – The Financial Hacker [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] Källa: Get Rich Slowly – The Financial Hacker [&#8230;]</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
