<?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>Quantitative Finance &#38; Technical Trading &#187; Research</title>
	<atom:link href="http://www.quantf.com/category/research/feed" rel="self" type="application/rss+xml" />
	<link>http://www.quantf.com</link>
	<description>&#34;One faces the future with one&#039;s past&#34; Pearl S. Buck (1892-1973)</description>
	<lastBuildDate>Thu, 18 Apr 2013 13:48:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Important News and Updates!</title>
		<link>http://www.quantf.com/fotis-papailias/important-news-and-updates/2021</link>
		<comments>http://www.quantf.com/fotis-papailias/important-news-and-updates/2021#comments</comments>
		<pubDate>Thu, 20 Dec 2012 10:09:28 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=2021</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/important-news-and-updates/2021">Important News and Updates!</a></p><p>Our website will be soon one year old and some major updates are under consideration! Please read below. 1) Daily FOREX Correlation (NEW!): We will update every day estimates of the correlation for all currencies. This methodology is based on a new academic research paper of ours and can be used for hedging purposes. It [...]</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/important-news-and-updates/2021">Important News and Updates!</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/important-news-and-updates/2021">Important News and Updates!</a></p><p>Our website will be soon one year old and some major updates are under consideration! Please read below.</p>
<p>1) Daily FOREX Correlation (<span style="color: #ff0000;"><strong>NEW!</strong></span>): We will update every day estimates of the correlation for all currencies. This methodology is based on a new academic research paper of ours and can be used for hedging purposes. It will be updated daily - <span style="text-decoration: underline;"><strong>After December 2012</strong></span></p>
<p>2) Daily FOREX Picks (<span style="color: #ff0000;"><strong>NEW!</strong></span>): Based on the above, we will also create a strategy that invests in 6 currencies. The performance of this FX portfolio will be tracked online &#8211; <span style="text-decoration: underline;"><strong>After December 2012</strong></span></p>
<p>3) ETF Switcher (Daily): Some of all strategies will be kept &#8211; <span style="text-decoration: underline;"><strong>After February 2013</strong></span></p>
<p>4) Risk Sentiment Indicators based on ETFs will be extracted from ETF Switcher and will be presented separately  - <span style="text-decoration: underline;"><strong>After February 2013</strong></span></p>
<p>5) TNA/TZA Pairs Trading (Weekly): This will be changed and updates will be daily - <span style="text-decoration: underline;"><strong>After February 2013</strong></span></p>
<p>6) FAS/FAZ Pairs Trading (<span style="color: #ff0000;"><strong>NEW!</strong></span>): A similar strategy to TNA/TZA will be applied in FAS/FAZ  with daily updates &#8211; <span style="text-decoration: underline;"><strong>After February 2013</strong></span></p>
<p>&nbsp;</p>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/important-news-and-updates/2021">Important News and Updates!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/important-news-and-updates/2021/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Stock Market and US elections</title>
		<link>http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602</link>
		<comments>http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602#comments</comments>
		<pubDate>Wed, 19 Sep 2012 14:23:10 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[r-bloggers]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=1602</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602">Stock Market and US elections</a></p><p>We made a very simple R file that historically gathers the period before and after the US elections. The inexperienced user has the ability to set the tickers of asset she wants to study and the look-back and look-forward periods. Most of the functions are wrapped up and can be found in a separate file here http://www.quantf.com/download2/US-elections-procs.R [...]</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602">Stock Market and US elections</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602">Stock Market and US elections</a></p><p>We made a very simple R file that historically gathers the period before and after the US elections. The inexperienced user has the ability to set the tickers of asset she wants to study and the look-back and look-forward periods. Most of the functions are wrapped up and can be found in a separate file here http://www.quantf.com/download2/US-elections-procs.R , so that all experienced users can open and edit the source file.</p>
<p>Looking at SP-500, NASDAQ-100 and RUSSELL-2000 graphs we see that in 1980, 1984, 1988, 1992, 2000, 2004 and 2008 there was rise in the market some weeks before the elections (something similar happened last week due to the QE Fed announcement). Then we have an decrease and as we approach to the elections the market goes up again. A similar decrease started last Friday at the end of day and continued on Monday and Tuesday.</p>
<p>Bottomline: pre-elections periods can be tricky so have it in mind and be prepared!</p>
<p>&nbsp;</p>
<pre># Written by D. Thomakos and F. Papailias
#
# Contact Details: papailias@quantf.com
# dimitrios.thomakos@gmail.com, thomakos@quantf.com
#
# All material is provided for use as is, with no guarrantees, either expressed or implied.
# Copyright (C) under the authors' names Papailias, Fotis and Thomakos, Dimitrios for both
#
#-------------------------------------------------------------------------#
# Quantitative Finance &amp; Technical Trading #
# http://www.quantf.com #
#-------------------------------------------------------------------------#
# 
# PLEASE MAINTAIN THIS HEADER IN ALL COPIES OF THIS FILE THAT YOU USE</pre>
<pre># Remove everything to start from scratch
rm(list=ls(all=TRUE))
#------------------------ USER INPUT -----------------------------#
# Select the assets you need. Here we use SP-500, NASDAQ-100, RUSSELL-2000, TNA, TZA, FAZ, FAS
tickers.all &lt;- c("^GSPC", "^NDX", "^RUT", "SPY")</pre>
<pre>ndays &lt;- 60 # calendar days
nrows &lt;- 60 # trading days</pre>
<pre>source("http://www.quantf.com/download2/US-elections-procs.R")</pre>
<pre>for(i in seq(1, length(tickers.all), 1))
{
 wrap.n.plot(prices, tickers.all[i], dates, ndays, nrows, ele)
}</pre>
<pre></pre>
<pre></pre>

<a href='http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602/us-ele-1' title='us-ele-1'><img width="150" height="150" src="http://www.quantf.com/wp-content/uploads/2012/09/us-ele-1-150x150.png" class="attachment-thumbnail" alt="us-ele-1" /></a>
<a href='http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602/us-ele-2' title='us-ele-2'><img width="150" height="150" src="http://www.quantf.com/wp-content/uploads/2012/09/us-ele-2-150x150.png" class="attachment-thumbnail" alt="us-ele-2" /></a>
<a href='http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602/us-ele-3' title='us-ele-3'><img width="150" height="150" src="http://www.quantf.com/wp-content/uploads/2012/09/us-ele-3-150x150.png" class="attachment-thumbnail" alt="us-ele-3" /></a>

<pre></pre>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602">Stock Market and US elections</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/stock-market-and-us-elections/1602/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IMA article published in Market Technician &#8211; The Journal of the Society of Technical Analysts, UK</title>
		<link>http://www.quantf.com/fotis-papailias/ima-article-published-in-market-technician-the-journal-of-the-society-for-technical-analysts-uk/1361</link>
		<comments>http://www.quantf.com/fotis-papailias/ima-article-published-in-market-technician-the-journal-of-the-society-for-technical-analysts-uk/1361#comments</comments>
		<pubDate>Thu, 05 Jul 2012 14:18:33 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=1361</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ima-article-published-in-market-technician-the-journal-of-the-society-for-technical-analysts-uk/1361">IMA article published in Market Technician &#8211; The Journal of the Society of Technical Analysts, UK</a></p><p>We are more than happy to announce that a small article based on our Improved Moving Average Strategies (you can find more here) has been published in Market Technician. We are indebted to the board of the Journal that has allowed us to re-distribute the article freely. &#160; &#160; or download the .pdf here &#160; Kind [...]</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ima-article-published-in-market-technician-the-journal-of-the-society-for-technical-analysts-uk/1361">IMA article published in Market Technician &#8211; The Journal of the Society of Technical Analysts, UK</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ima-article-published-in-market-technician-the-journal-of-the-society-for-technical-analysts-uk/1361">IMA article published in Market Technician &#8211; The Journal of the Society of Technical Analysts, UK</a></p><p>We are more than happy to announce that a small article based on our Improved Moving Average Strategies (you can find more <a href="http://www.quantf.com/improved-ma">here</a>) has been published in Market Technician. We are indebted to the board of the Journal that has allowed us to re-distribute the article freely.</p>
<p>&nbsp;</p>

<div class="gde-error">GDE Error: Unable to load profile settings</div>

<p>&nbsp;</p>
<p>or download the .pdf <a href="http://www.quantf.com/download2/MT-72%20Papailias-Thomakos%20article.pdf" target="_blank">here</a></p>
<p>&nbsp;</p>
<p>Kind Regards,</p>
<p>Fotis</p>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ima-article-published-in-market-technician-the-journal-of-the-society-for-technical-analysts-uk/1361">IMA article published in Market Technician &#8211; The Journal of the Society of Technical Analysts, UK</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/ima-article-published-in-market-technician-the-journal-of-the-society-for-technical-analysts-uk/1361/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IMA Article published in the Market Technician &#8211; The Journal of the Society of Technical Analysts (UK)</title>
		<link>http://www.quantf.com/fotis-papailias/ima-article-published-market-technician-journal-society-technical-analysts-uk/1136</link>
		<comments>http://www.quantf.com/fotis-papailias/ima-article-published-market-technician-journal-society-technical-analysts-uk/1136#comments</comments>
		<pubDate>Thu, 31 May 2012 10:36:09 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=1136</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ima-article-published-market-technician-journal-society-technical-analysts-uk/1136">IMA Article published in the Market Technician &#8211; The Journal of the Society of Technical Analysts (UK)</a></p><p>It is with great pleasure to announce that the current issue of the Market Technician &#8211; The Journal of the Society of Technical Analysts (UK), includes a non-technical note of our Improved Moving Average! Please visit the following link http://www.sta-uk.org/sta_market_technician.html &#160;</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ima-article-published-market-technician-journal-society-technical-analysts-uk/1136">IMA Article published in the Market Technician &#8211; The Journal of the Society of Technical Analysts (UK)</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ima-article-published-market-technician-journal-society-technical-analysts-uk/1136">IMA Article published in the Market Technician &#8211; The Journal of the Society of Technical Analysts (UK)</a></p><p>It is with great pleasure to announce that the current issue of the Market Technician &#8211; The Journal of the Society of Technical Analysts (UK), includes a non-technical note of our Improved Moving Average!</p>
<p>Please visit the following link</p>
<p><a href="http://www.sta-uk.org/sta_market_technician.html" target="_blank">http://www.sta-uk.org/sta_market_technician.html</a></p>
<p>&nbsp;</p>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ima-article-published-market-technician-journal-society-technical-analysts-uk/1136">IMA Article published in the Market Technician &#8211; The Journal of the Society of Technical Analysts (UK)</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/ima-article-published-market-technician-journal-society-technical-analysts-uk/1136/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ichimoku Clouds R Code Trading</title>
		<link>http://www.quantf.com/fotis-papailias/ichimoku-clouds-r-code-trading/938</link>
		<comments>http://www.quantf.com/fotis-papailias/ichimoku-clouds-r-code-trading/938#comments</comments>
		<pubDate>Mon, 09 Apr 2012 11:57:54 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[forex-bloggers]]></category>
		<category><![CDATA[r-bloggers]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=938</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ichimoku-clouds-r-code-trading/938">Ichimoku Clouds R Code Trading</a></p><p>Download the full program here Here you can find an R Code for Ichimoku Clouds analysis and trading. Have fun! &#160; # The function for computing the Ichimoku cloud ichimoku &#60;- function(data,pars) { # REMEMBER THAT THE DATA SHOULD BE IN ORDER # # HIGH, LOW and CLOSE # # ========================================== # Number of observations [...]</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ichimoku-clouds-r-code-trading/938">Ichimoku Clouds R Code Trading</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ichimoku-clouds-r-code-trading/938">Ichimoku Clouds R Code Trading</a></p><p style="text-align: center;"><strong><span style="color: #ff0000;"><a href="http://www.quantf.com/wp-content/plugins/download-monitor/download.php?id=71"><span style="color: #ff0000;">Download the full program here</span></a></span></strong></p>
<p><a href="http://www.quantf.com/wp-content/plugins/download-monitor/download.php?id=71">Here</a> you can find an R Code for Ichimoku Clouds analysis and trading.</p>
<p>Have fun!</p>

<a href='http://www.quantf.com/fotis-papailias/ichimoku-clouds-r-code-trading/938/ichi1' title='ichi1'><img width="150" height="150" src="http://www.quantf.com/wp-content/uploads/2012/04/ichi1-150x150.jpg" class="attachment-thumbnail" alt="ichi1" /></a>
<a href='http://www.quantf.com/fotis-papailias/ichimoku-clouds-r-code-trading/938/ichi2' title='ichi2'><img width="150" height="150" src="http://www.quantf.com/wp-content/uploads/2012/04/ichi2-150x150.jpg" class="attachment-thumbnail" alt="ichi2" /></a>

<p>&nbsp;</p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"># The function for computing the Ichimoku cloud</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;">ichimoku &lt;- function(data,pars)</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;">{</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # REMEMBER THAT THE DATA SHOULD BE IN ORDER</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> #</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> # HIGH, LOW and CLOSE</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> #</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> # ==========================================</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # Number of observations</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> Nobs &lt;- NROW(data)</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # Get the three parameters</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> p1 &lt;- pars[1]</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> p2 &lt;- pars[2]</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> p3 &lt;- pars[3]</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # The maximum of these should be p3, check</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> if ((p1 &gt; p2) | (p1 &gt; p3) | (p2 &gt; p3)) </span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> { </span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> stop(&#8220;parameters should enter in ascending order&#8221;) </span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> }</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> # Set the max</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> maxp &lt;- p3</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # You will leave out maxp observations</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> cloud.lines &lt;- matrix(0,nrow=Nobs-maxp,ncol=5)</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> colnames(cloud.lines) &lt;- c(&#8220;Tenkan&#8221;,&#8221;Kijun&#8221;,&#8221;SenkouA&#8221;,&#8221;SenkouB&#8221;,&#8221;Chikou&#8221;)</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # Run a loop to make the computations</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> for (i in seq(maxp+1,Nobs,1))</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> {</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> # Compute the cloud lines</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> tenkan &lt;- (max(data[seq(i-p1,i,1),1])+min(data[seq(i-p1,i,1),2]))/2</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> kijun &lt;- (max(data[seq(i-p2,i,1),1])+min(data[seq(i-p2,i,1),2]))/2</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> senkouA&lt;- (tenkan+kijun)/2</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> senkouB&lt;- (max(data[seq(i-p3,i,1),1])+min(data[seq(i-p3,i,1),2]))/2</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> chikou &lt;- data[i,3]</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # Save in appropriate places</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> cloud.lines[(i-maxp),] &lt;- c(tenkan,kijun,senkouA,senkouB,chikou) </span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> }</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # OK, now align them correctly: SenkouA and SenkouB are moved p2 periods forward</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> # while Chikou is moved p2 periods backward&#8230;</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> A1 &lt;- rbind(cloud.lines[,1:2],matrix(NA,p2,2))</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> A2 &lt;- rbind(matrix(NA,p2,2),cloud.lines[,3:4])</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> A3 &lt;- c(cloud.lines[(p2+1):(Nobs-maxp),5],matrix(NA,2*p2,1))</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> new.cloud.lines &lt;- cbind(A1,A2,A3)</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> colnames(new.cloud.lines) &lt;- colnames(cloud.lines)</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # Align the data as well</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> new.data &lt;- rbind(data[(maxp+1):Nobs,],matrix(NA,p2,3))</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> colnames(new.data) &lt;- colnames(data)</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"> # OK, return everything</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;"> return(list(data=new.data,cloud.lines=new.cloud.lines))</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;">}</span></p>
<p>&nbsp;</p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;"># Set the ichimoku parameters</span><br />
<span style="font-family: 'courier new', courier; font-size: 12px;">pars &lt;- c(50,100,120)</span></p>
<p><span style="font-family: 'courier new', courier; font-size: 12px;">out &lt;- ichimoku(x,pars)</span></p>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/ichimoku-clouds-r-code-trading/938">Ichimoku Clouds R Code Trading</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/ichimoku-clouds-r-code-trading/938/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparing the Business Cycles of Greece and Germany</title>
		<link>http://www.quantf.com/fotis-papailias/comparing-the-business-cycles-of-greece-and-germany/643</link>
		<comments>http://www.quantf.com/fotis-papailias/comparing-the-business-cycles-of-greece-and-germany/643#comments</comments>
		<pubDate>Wed, 15 Feb 2012 09:47:10 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=643</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/comparing-the-business-cycles-of-greece-and-germany/643">Comparing the Business Cycles of Greece and Germany</a></p><p>Full post available at http://proeconomia.wordpress.com/2012/02/14/here-is-the-economic-sentiment-data-for-germany-and-greece-and-some-econometrics-too/ &#160; &#8230;.You can see that the (rolling) correlation (right-hand axis) exhibits a break after the two series bottom down in early 2009. After than the German economic sentiment skyrockets(!) while the Greek on flunctuates and slowly decreases. The 2.5-year correltion has now turned negative and it appears that the series have [...]</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/comparing-the-business-cycles-of-greece-and-germany/643">Comparing the Business Cycles of Greece and Germany</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/comparing-the-business-cycles-of-greece-and-germany/643">Comparing the Business Cycles of Greece and Germany</a></p><p>Full post available at <a href="http://proeconomia.wordpress.com/2012/02/14/here-is-the-economic-sentiment-data-for-germany-and-greece-and-some-econometrics-too/" target="_blank">http://proeconomia.wordpress.com/2012/02/14/here-is-the-economic-sentiment-data-for-germany-and-greece-and-some-econometrics-too/</a></p>
<p>&nbsp;</p>
<blockquote><p>&#8230;.You can see that the (rolling) correlation (right-hand axis) exhibits a break after the two series bottom down in early 2009. After than the German economic sentiment skyrockets(!) while the Greek on flunctuates and slowly decreases. The 2.5-year correltion has now turned negative and it appears that the series have lost their synchronicity. Doing some spectral analysis (details available) one can see that the series are strongly correlated at all periods greater than 4 months but this correlation disappears in smaller periods – essentially the same story that the rolling correlation goes. Furthermore, a formal test of cycle synchronicity (again, details are available) accepts synchronicity before 2008 but rejects synchronicity after it. All these results are very interesting since they show that once the crisis was well under way the forward looking behavior of the Germans became optimistic, in fact it exploded&#8230;.</p></blockquote>
<p>&nbsp;</p>
<p style="text-align: center;"><a href="http://www.quantf.com/wp-content/uploads/2012/02/esi_example.png" target="_blank"><img class="aligncenter size-medium wp-image-657" title="esi_example" src="http://www.quantf.com/wp-content/uploads/2012/02/esi_example-300x196.png" alt="" width="300" height="196" /></a></p>
<p>&nbsp;</p>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/comparing-the-business-cycles-of-greece-and-germany/643">Comparing the Business Cycles of Greece and Germany</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/comparing-the-business-cycles-of-greece-and-germany/643/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>R-Code Yahoo Finance Data Loading</title>
		<link>http://www.quantf.com/fotis-papailias/r-code-yahoo-finance-data-loading/507</link>
		<comments>http://www.quantf.com/fotis-papailias/r-code-yahoo-finance-data-loading/507#comments</comments>
		<pubDate>Tue, 17 Jan 2012 15:37:19 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[r-bloggers]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=507</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/r-code-yahoo-finance-data-loading/507">R-Code Yahoo Finance Data Loading</a></p><p>Here is an R script that downloads Yahoo Finance Data without the need of additional packages/libraries. In the .zip file is the code with an example on how to use it. Download the code here: You can also find it under the &#8220;Downloads&#8221; Section of our site. # Function and example code for loading finance [...]</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/r-code-yahoo-finance-data-loading/507">R-Code Yahoo Finance Data Loading</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/r-code-yahoo-finance-data-loading/507">R-Code Yahoo Finance Data Loading</a></p><p>Here is an R script that downloads Yahoo Finance Data without the need of additional packages/libraries.</p>
<p>In the .zip file is the code with an example on how to use it.</p>
<p>Download the code here: <a href="http://www.quantf.com/wp-content/plugins/download-monitor/download.php?id=10">R Code - Yahoo Data Loading</a></p>
<p>You can also find it under the &#8220;<a title="Downloads" href="http://www.quantf.com/downloads">Downloads</a>&#8221; Section of our site.</p>
<pre class="brush: python; gutter: true; first-line: 1"># Function and example code for loading finance data from Yahoo
# without the need of any additional package.
#
# Written by Fotis Papailias &amp; Dimitrios Thomakos on Dec. 31, 2011
# Contact Details: papailias@quantf.com
#                  dimitrios.thomakos@gmail.com, thomakos@quantf.com
#
# All material is provided for use as is, with no guarrantees, either expressed or implied.
# Copyright (C) under the authors' names Papailias, Fotis and Thomakos, Dimitrios for both
#
#-------------------------------------------------------------------------#
#             Quantitative Finance &amp; Technical Trading                    #
#                     http://www.quantf.com                               #
#-------------------------------------------------------------------------#
#
# PLEASE MAINTAIN THIS HEADER IN ALL COPIES OF THIS FILE THAT YOU USE

###############################################################################################
# Main Function
#
# Input
# -----
#   tickers (text strings)
#   start.date (dates)
#   end.date (dates)
#
# Output
# -------
# 6 Double Matrices: Open, High, Low, Close, Volume, Adj. Close
###############################################################################################

data.loading &lt;- function(tickers, start.date, end.date)
{
  # Change the locale
  sl &lt;- Sys.setlocale(locale="US")

  # Create the universe of dates
  all.dates &lt;- seq(as.Date(start.date), as.Date(end.date), by="day")
  all.dates &lt;- subset(all.dates,weekdays(all.dates) != "Sunday" &amp; weekdays(all.dates) != "Saturday")
  all.dates.char &lt;- as.matrix(as.character(all.dates))

  # Create sparse matrices
  open &lt;- matrix(NA, NROW(all.dates.char), length(tickers))
  hi &lt;- open
  low &lt;- open
  close &lt;- open
  volume &lt;- open
  adj.close &lt;- open

  # Name the rows correctly
  rownames(open) &lt;- all.dates.char
  rownames(hi) &lt;- all.dates.char
  rownames(low) &lt;- all.dates.char
  rownames(close) &lt;- all.dates.char
  rownames(volume) &lt;- all.dates.char
  rownames(adj.close) &lt;- all.dates.char

  # Split the start and end dates to be used in the ULR later on
  splt &lt;- unlist(strsplit(start.date, "-"))
  a &lt;- as.character(as.numeric(splt[2])-1)
  b &lt;- splt[3]
  c &lt;- splt[1]

  splt &lt;- unlist(strsplit(end.date, "-"))
  d &lt;- as.character(as.numeric(splt[2])-1)
  e &lt;- splt[3]
  f &lt;- splt[1]

  # Create the two out of the three basic components for the URL loading
  str1 &lt;- "http://ichart.finance.yahoo.com/table.csv?s="
  str3 &lt;- paste("&amp;a=", a, "&amp;b=", b, "&amp;c=", c, "&amp;d=", d, "&amp;e=", e, "&amp;f=", f, "&amp;g=d&amp;ignore=.csv", sep="")

  # Main loop for all assets
  for (i in seq(1,length(tickers),1))
    {
      str2 &lt;- tickers[i]
      strx &lt;- paste(str1,str2,str3,sep="")
      x &lt;- read.csv(strx)

      datess &lt;- as.matrix(x[1])

      replacing &lt;- match(datess, all.dates.char)
      open[replacing,i] &lt;- as.matrix(x[2])
      hi[replacing,i] &lt;- as.matrix(x[3])
      low[replacing,i] &lt;- as.matrix(x[4])
      close[replacing,i] &lt;- as.matrix(x[5])
      volume[replacing,i] &lt;- as.matrix(x[6])
      adj.close[replacing,i] &lt;- as.matrix(x[7])
  }

  # Name the cols correctly
  colnames(open) &lt;- tickers
  colnames(hi) &lt;- tickers
  colnames(low) &lt;- tickers
  colnames(close) &lt;- tickers
  colnames(volume) &lt;- tickers
  colnames(adj.close) &lt;- tickers

  # Return the ouput
  return(list(open=open, high=hi, low=low, close=close, volume=volume, adj.close=adj.close))
}</pre>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/r-code-yahoo-finance-data-loading/507">R-Code Yahoo Finance Data Loading</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/r-code-yahoo-finance-data-loading/507/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Multiple RSS Feeds for Different Categories</title>
		<link>http://www.quantf.com/fotis-papailias/multiple-rss-feeds-for-different-categories/477</link>
		<comments>http://www.quantf.com/fotis-papailias/multiple-rss-feeds-for-different-categories/477#comments</comments>
		<pubDate>Sun, 15 Jan 2012 14:55:41 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=477</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/multiple-rss-feeds-for-different-categories/477">Multiple RSS Feeds for Different Categories</a></p><p>Dear All, We have created multiple RSS feeds (right menu) that track different categories of our site. If you are interested in all topics you can subsribe to the first feed. If you are interested in specific categories please use the relevant feeds.  Subscribe to All Topics  Subscribe to Comments  Subscribe to Research  Subscribe to Global ETF Switcher Strategies [...]</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/multiple-rss-feeds-for-different-categories/477">Multiple RSS Feeds for Different Categories</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/multiple-rss-feeds-for-different-categories/477">Multiple RSS Feeds for Different Categories</a></p><p>Dear All,</p>
<p>We have created multiple RSS feeds (right menu) that track different categories of our site. If you are interested in all topics you can subsribe to the first feed. If you are interested in specific categories please use the relevant feeds.</p>
<p><img style="width: 16px; height: 16px;" src="http://www.quantf.com/feed2.png" alt="" /> <a href="http://www.quantf.com/feed">Subscribe to All Topics</a><br />
<img style="width: 16px; height: 16px;" src="http://www.quantf.com/feed2.png" alt="" /> <a href="http://www.quantf.com/comments/feed">Subscribe to Comments</a><br />
<img style="width: 16px; height: 16px;" src="http://www.quantf.com/feed2.png" alt="" /> <a href="http://www.quantf.com/category/research/feed">Subscribe to Research</a><br />
<img style="width: 16px; height: 16px;" src="http://www.quantf.com/feed2.png" alt="" /> <a href="http://www.quantf.com/category/global-etf-strategies/feed">Subscribe to Global ETF Switcher Strategies &amp; Picks</a></p>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/multiple-rss-feeds-for-different-categories/477">Multiple RSS Feeds for Different Categories</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/multiple-rss-feeds-for-different-categories/477/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Global ETF Switcher &amp; Daily Suggestions&#8230;. Coming Soon!!!</title>
		<link>http://www.quantf.com/fotis-papailias/global-etf-switcher-daily-suggestions-coming-soon/408</link>
		<comments>http://www.quantf.com/fotis-papailias/global-etf-switcher-daily-suggestions-coming-soon/408#comments</comments>
		<pubDate>Fri, 06 Jan 2012 17:29:50 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=408</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/global-etf-switcher-daily-suggestions-coming-soon/408">Global ETF Switcher &#038; Daily Suggestions&#8230;. Coming Soon!!!</a></p><p>Happy New Year to everybody!! We wish 2012 to bring joy and happiness to us all (&#8230;..some profits are also welcome!!). This is a post/announcement that we will be enhancing our blog with two new pages with daily updates. 1) Global ETF Switcher: Here, we will present a collection of (NYSE) ETFs that track indices in differnet [...]</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/global-etf-switcher-daily-suggestions-coming-soon/408">Global ETF Switcher &#038; Daily Suggestions&#8230;. Coming Soon!!!</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/global-etf-switcher-daily-suggestions-coming-soon/408">Global ETF Switcher &#038; Daily Suggestions&#8230;. Coming Soon!!!</a></p><p>Happy New Year to everybody!!</p>
<p>We wish 2012 to bring joy and happiness to us all (&#8230;..some profits are also welcome!!).</p>
<p>This is a post/announcement that we will be enhancing our blog with two new pages with daily updates.</p>
<p>1)<strong> Global ETF Switcher</strong>: Here, we will present a collection of (NYSE) ETFs that track indices in differnet countries in the world and we will accompany them with a Switch (On or Off) that will indicate the mood of the market.</p>
<p>2) <strong>Daily Suggestions:</strong> From the collection of ETFs used in (1), we will give daily picks and we will track the performance of different strategies at the end of each month.</p>
<p>A detailed report of (1) and (2) will be uploaded every day in .pdf format and we will also post (and tweet) our daily picks.</p>
<p>Stay tuned&#8230;</p>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/global-etf-switcher-daily-suggestions-coming-soon/408">Global ETF Switcher &#038; Daily Suggestions&#8230;. Coming Soon!!!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/global-etf-switcher-daily-suggestions-coming-soon/408/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the Improved MA: Recent Feedback and further Instructions!</title>
		<link>http://www.quantf.com/fotis-papailias/using-the-improved-ma-recent-feedback-and-further-instructions/397</link>
		<comments>http://www.quantf.com/fotis-papailias/using-the-improved-ma-recent-feedback-and-further-instructions/397#comments</comments>
		<pubDate>Wed, 28 Dec 2011 19:03:57 +0000</pubDate>
		<dc:creator>Fotis</dc:creator>
				<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://www.quantf.com/?p=397</guid>
		<description><![CDATA[<p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/using-the-improved-ma-recent-feedback-and-further-instructions/397">Using the Improved MA: Recent Feedback and further Instructions!</a></p><p>Hello and Merry Xmas! We had been recently contacted by a reader of our blog who couldn&#8217;t find much difference using the IMA. The main question was that a simple (50, 200) EMA did the best on several indices. The way IMA is constructed does not necessarily mean that IMA is always better to the [...]</p></p><p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/using-the-improved-ma-recent-feedback-and-further-instructions/397">Using the Improved MA: Recent Feedback and further Instructions!</a></p>]]></description>
				<content:encoded><![CDATA[<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/using-the-improved-ma-recent-feedback-and-further-instructions/397">Using the Improved MA: Recent Feedback and further Instructions!</a></p><p>Hello and Merry Xmas!</p>
<p>We had been recently contacted by a reader of our blog who couldn&#8217;t find much difference using the IMA. The main question was that a simple (50, 200) EMA did the best on several indices.</p>
<p>The way IMA is constructed does not necessarily mean that IMA is always better to the usual MA indicator which is based on. However, if there is an active trader who constructs her strategy using MA rules (exclusively), our claim is that it is highly likely that she will be better off using the IMA backtesting all combinations.</p>
<p><a href="http://www.quantf.com/wp-content/plugins/download-monitor/download.php?id=7">Click here to download an .xlsx file as an example on SPY</a>. The data was collected from Yahoo,&nbsp;starting from 2004-01-01 to 2011-12-22 using the code we have uploaded on our site. (<a title="IMA R Code" href="http://www.quantf.com/ima-code" target="_blank">click here for the code</a>) (To keep thing simple, exit threshold is zero).</p>
<p>If someone is interested entirely on SMA, then she has to look at table 1 (only). In this table we see that IMA does not provide better results and the investor is better off using the MA cross-over rule with short MA = 50 days, long MA = 200 days. Please note that Sharpe in this case is 0.511 and Cumulative Return is 0.533.</p>
<p>Our suggestion is that the investor should not trust the SMA at all cases (or just one MA strategy). She should use backtesting and try different combinations for short and long MA periods as well as different MA methods (i.e. weighted MA, exponential MA etc). If we look at table 2, that provides the output for different EMA combinations, we see that the best strategy (across all tables) is the one based on the long EMA with 100 days. The Sharpe Ration here is 0.787 and the Cumulative Return is 0.733 (20% more!).</p>
<p>Hence, the above could be summarized in the following algorithm.</p>
<p>Using the Improved MA Criterion:</p>
<ol>
<ul>
<li>Set different combinations for short and long MAs (e.g. (k1,k2)={(10, 20), (20, 50), (20,100), (50,100), (20,200), (50,200), (100,200)} (or anything you find useful)</li>
</ul>
</ol>
<ol>
<ul>
<li>Use the above lengths in SMA, WMA, EMA and their Improved MA versions&nbsp;</li>
</ul>
</ol>
<ol>
<ul>
<li>Compare their performance in backtesting (The choice of Exit Threshold is advised to be chosen using backtesting as well)</li>
</ul>
</ol>
<p>Then, it is highly likely (but not 100% guaranteed!) that the investor is better off using an Improved version of a criterion.</p>
<p>Here is the comparison.</p>
<p>&nbsp;</p>
<div>
<table width="704" border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="64" /></colgroup>
<colgroup>
<col span="10" width="64" /> </colgroup>
<tbody>
<tr>
<td class="xl77" width="64" height="19">&nbsp;</td>
<td class="xl78" style="text-align: center;" colspan="10" width="640"><strong>Simple MA (50,200)</strong></td>
</tr>
<tr>
<td class="xl80" height="19">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="xl81">&nbsp;</td>
</tr>
<tr>
<td class="xl80" height="19">&nbsp;</td>
<td class="xl65" style="text-align: right;">Ret-MA1</td>
<td class="xl66" style="text-align: right;">Ret-MA2</td>
<td class="xl66" style="text-align: right;"><strong><span style="color: #ff0000;">Ret-MAC</span></strong></td>
<td class="xl65" style="text-align: right;">Ret-IMA1</td>
<td class="xl66" style="text-align: right;">Ret-IMA2</td>
<td class="xl67" style="text-align: right;">Ret-IMC</td>
<td class="xl65" style="text-align: right;">Ret-IV1</td>
<td class="xl66" style="text-align: right;">Ret-IV2</td>
<td class="xl67" style="text-align: right;">Ret-IVC</td>
<td class="xl82" style="text-align: right;">Ret-BnH</td>
</tr>
<tr>
<td class="xl80" height="19">Average</td>
<td class="xl68" align="right">0.041</td>
<td class="xl69" align="right">0.037</td>
<td class="xl69" align="right">0.061</td>
<td class="xl68" align="right">0.051</td>
<td class="xl69" align="right">0.010</td>
<td class="xl70" align="right">-0.003</td>
<td class="xl68" align="right">0.046</td>
<td class="xl69" align="right">0.041</td>
<td class="xl70" align="right">0.056</td>
<td class="xl83" align="right">0.060</td>
</tr>
<tr>
<td class="xl80" height="19">Volatility</td>
<td class="xl64" align="right">0.107</td>
<td class="xl71" align="right">0.105</td>
<td class="xl71" align="right">0.119</td>
<td class="xl64" align="right">0.107</td>
<td class="xl71" align="right">0.062</td>
<td class="xl72" align="right">0.012</td>
<td class="xl64" align="right">0.105</td>
<td class="xl71" align="right">0.101</td>
<td class="xl72" align="right">0.116</td>
<td class="xl84" align="right">0.220</td>
</tr>
<tr>
<td class="xl80" height="19">Sharpe</td>
<td class="xl64" align="right">0.380</td>
<td class="xl71" align="right">0.350</td>
<td class="xl87" align="right"><span style="color: #ff0000;"><strong>0.511</strong></span></td>
<td class="xl64" align="right">0.471</td>
<td class="xl71" align="right">0.165</td>
<td class="xl72" align="right">-0.246</td>
<td class="xl64" align="right">0.435</td>
<td class="xl71" align="right">0.403</td>
<td class="xl72" align="right">0.485</td>
<td class="xl84" align="right">0.272</td>
</tr>
<tr>
<td class="xl80" height="19">Max</td>
<td class="xl64" align="right">0.040</td>
<td class="xl71" align="right">0.044</td>
<td class="xl71" align="right">0.047</td>
<td class="xl64" align="right">0.044</td>
<td class="xl71" align="right">0.026</td>
<td class="xl72" align="right">0.010</td>
<td class="xl64" align="right">0.040</td>
<td class="xl71" align="right">0.044</td>
<td class="xl72" align="right">0.047</td>
<td class="xl84" align="right">0.145</td>
</tr>
<tr>
<td class="xl80" height="19">Min</td>
<td class="xl64" align="right">-0.046</td>
<td class="xl71" align="right">-0.039</td>
<td class="xl71" align="right">-0.065</td>
<td class="xl64" align="right">-0.048</td>
<td class="xl71" align="right">-0.039</td>
<td class="xl72" align="right">-0.030</td>
<td class="xl64" align="right">-0.046</td>
<td class="xl71" align="right">-0.039</td>
<td class="xl72" align="right">-0.065</td>
<td class="xl84" align="right">-0.098</td>
</tr>
<tr>
<td class="xl80" height="19">Cumulative</td>
<td class="xl64" align="right">0.322</td>
<td class="xl71" align="right">0.283</td>
<td class="xl87" align="right"><span style="color: #ff0000;"><strong>0.533</strong></span></td>
<td class="xl64" align="right">0.428</td>
<td class="xl71" align="right">0.068</td>
<td class="xl72" align="right">-0.024</td>
<td class="xl64" align="right">0.376</td>
<td class="xl71" align="right">0.327</td>
<td class="xl72" align="right">0.482</td>
<td class="xl84" align="right">0.328</td>
</tr>
<tr>
<td class="xl80" height="19">Drawdown</td>
<td class="xl64" align="right">0.258</td>
<td class="xl71" align="right">0.233</td>
<td class="xl71" align="right"><span style="color: #ff0000;"><strong>0.173</strong></span></td>
<td class="xl64" align="right">0.231</td>
<td class="xl71" align="right">0.198</td>
<td class="xl72" align="right">0.042</td>
<td class="xl64" align="right">0.240</td>
<td class="xl71" align="right">0.182</td>
<td class="xl72" align="right">0.177</td>
<td class="xl84" align="right">0.552</td>
</tr>
<tr>
<td class="xl80" height="19">Duration</td>
<td class="xl63" align="right">652</td>
<td align="right">620</td>
<td align="right"><span style="color: #000000;">450</span></td>
<td class="xl63" align="right">497</td>
<td align="right">1119</td>
<td class="xl73" align="right">635</td>
<td class="xl63" align="right">507</td>
<td align="right">587</td>
<td class="xl73" align="right">460</td>
<td class="xl85" align="right">1062</td>
</tr>
<tr>
<td class="xl80" height="19">Profit/Loss</td>
<td class="xl64" align="right">0.854</td>
<td class="xl71" align="right">0.840</td>
<td class="xl71" align="right">0.860</td>
<td class="xl64" align="right">0.874</td>
<td class="xl71" align="right">0.856</td>
<td class="xl72" align="right">0.442</td>
<td class="xl64" align="right">0.869</td>
<td class="xl71" align="right">0.843</td>
<td class="xl72" align="right">0.864</td>
<td class="xl84" align="right">0.855</td>
</tr>
<tr>
<td class="xl80" height="19">Win Rate</td>
<td class="xl64" align="right">0.316</td>
<td class="xl71" align="right">0.346</td>
<td class="xl71" align="right">0.350</td>
<td class="xl64" align="right">0.269</td>
<td class="xl71" align="right">0.140</td>
<td class="xl72" align="right">0.002</td>
<td class="xl64" align="right">0.302</td>
<td class="xl71" align="right">0.332</td>
<td class="xl72" align="right">0.341</td>
<td class="xl84" align="right">0.550</td>
</tr>
<tr>
<td class="xl80" height="19">Expectation</td>
<td class="xl74" align="right">-0.414</td>
<td class="xl75" align="right">-0.364</td>
<td class="xl75" align="right">-0.349</td>
<td class="xl74" align="right">-0.497</td>
<td class="xl75" align="right">-0.741</td>
<td class="xl76" align="right">-0.997</td>
<td class="xl74" align="right">-0.437</td>
<td class="xl75" align="right">-0.388</td>
<td class="xl76" align="right">-0.364</td>
<td class="xl86" align="right">0.020</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<table width="704" border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="64" /></colgroup>
<colgroup>
<col span="10" width="64" /> </colgroup>
<tbody>
<tr>
<td class="xl82" width="64" height="19">&nbsp;</td>
<td class="xl84" style="text-align: center;" colspan="10" width="640"><strong>Exponential MA (20,100)</strong></td>
</tr>
<tr>
<td class="xl83" height="19">&nbsp;</td>
<td class="xl65">&nbsp;</td>
<td class="xl65">&nbsp;</td>
<td class="xl65">&nbsp;</td>
<td class="xl65">&nbsp;</td>
<td class="xl65">&nbsp;</td>
<td class="xl65">&nbsp;</td>
<td class="xl65">&nbsp;</td>
<td class="xl65">&nbsp;</td>
<td class="xl65">&nbsp;</td>
<td class="xl86">&nbsp;</td>
</tr>
<tr>
<td class="xl83" height="19">&nbsp;</td>
<td class="xl66" style="text-align: right;">Ret-MA1</td>
<td class="xl67" style="text-align: right;">Ret-MA2</td>
<td class="xl67" style="text-align: right;">Ret-MAC</td>
<td class="xl66" style="text-align: right;">Ret-IMA1</td>
<td class="xl67" style="text-align: right;"><span style="color: #008000;"><strong>Ret-IMA2</strong></span></td>
<td class="xl68" style="text-align: right;">Ret-IMC</td>
<td class="xl66" style="text-align: right;">Ret-IV1</td>
<td class="xl67" style="text-align: right;">Ret-IV2</td>
<td class="xl68" style="text-align: right;">Ret-IVC</td>
<td class="xl87" style="text-align: right;">Ret-BnH</td>
</tr>
<tr>
<td class="xl83" height="19">Average</td>
<td class="xl69" align="right">-0.010</td>
<td class="xl70" align="right">0.046</td>
<td class="xl70" align="right">0.030</td>
<td class="xl69" align="right">0.026</td>
<td class="xl70" align="right">0.073</td>
<td class="xl71" align="right">0.019</td>
<td class="xl69" align="right">0.016</td>
<td class="xl70" align="right">0.048</td>
<td class="xl71" align="right">0.027</td>
<td class="xl88" align="right">0.060</td>
</tr>
<tr>
<td class="xl83" height="19">Volatility</td>
<td class="xl72" align="right">0.123</td>
<td class="xl73" align="right">0.107</td>
<td class="xl73" align="right">0.111</td>
<td class="xl72" align="right">0.103</td>
<td class="xl73" align="right">0.093</td>
<td class="xl74" align="right">0.059</td>
<td class="xl72" align="right">0.117</td>
<td class="xl73" align="right">0.104</td>
<td class="xl74" align="right">0.100</td>
<td class="xl89" align="right">0.220</td>
</tr>
<tr>
<td class="xl83" height="19">Sharpe</td>
<td class="xl72" align="right">-0.077</td>
<td class="xl73" align="right">0.430</td>
<td class="xl73" align="right">0.268</td>
<td class="xl72" align="right">0.254</td>
<td class="xl81" align="right"><span style="color: #008000;"><strong>0.787</strong></span></td>
<td class="xl74" align="right">0.316</td>
<td class="xl72" align="right">0.133</td>
<td class="xl73" align="right">0.460</td>
<td class="xl74" align="right">0.270</td>
<td class="xl89" align="right">0.272</td>
</tr>
<tr>
<td class="xl83" height="19">Max</td>
<td class="xl72" align="right">0.072</td>
<td class="xl73" align="right">0.035</td>
<td class="xl73" align="right">0.044</td>
<td class="xl72" align="right">0.047</td>
<td class="xl73" align="right">0.044</td>
<td class="xl74" align="right">0.023</td>
<td class="xl72" align="right">0.072</td>
<td class="xl73" align="right">0.034</td>
<td class="xl74" align="right">0.044</td>
<td class="xl89" align="right">0.145</td>
</tr>
<tr>
<td class="xl83" height="19">Min</td>
<td class="xl72" align="right">-0.089</td>
<td class="xl73" align="right">-0.042</td>
<td class="xl73" align="right">-0.047</td>
<td class="xl72" align="right">-0.089</td>
<td class="xl73" align="right">-0.042</td>
<td class="xl74" align="right">-0.028</td>
<td class="xl72" align="right">-0.089</td>
<td class="xl73" align="right">-0.042</td>
<td class="xl74" align="right">-0.039</td>
<td class="xl89" align="right">-0.098</td>
</tr>
<tr>
<td class="xl83" height="19">Cumulative</td>
<td class="xl72" align="right">-0.127</td>
<td class="xl73" align="right">0.378</td>
<td class="xl73" align="right">0.206</td>
<td class="xl72" align="right">0.182</td>
<td class="xl81" align="right"><strong><span style="color: #008000;">0.733</span></strong></td>
<td class="xl74" align="right">0.143</td>
<td class="xl72" align="right">0.072</td>
<td class="xl73" align="right">0.402</td>
<td class="xl74" align="right">0.192</td>
<td class="xl89" align="right">0.328</td>
</tr>
<tr>
<td class="xl83" height="19">Drawdown</td>
<td class="xl72" align="right">0.439</td>
<td class="xl73" align="right">0.199</td>
<td class="xl73" align="right">0.254</td>
<td class="xl72" align="right">0.300</td>
<td class="xl73" align="right"><strong><span style="color: #008000;">0.147</span></strong></td>
<td class="xl74" align="right">0.097</td>
<td class="xl72" align="right">0.352</td>
<td class="xl73" align="right">0.182</td>
<td class="xl74" align="right">0.202</td>
<td class="xl89" align="right">0.552</td>
</tr>
<tr>
<td class="xl83" height="19">Duration</td>
<td class="xl75" align="right">1151</td>
<td class="xl65" align="right">561</td>
<td class="xl65" align="right">544</td>
<td class="xl76" align="right">909</td>
<td class="xl65" align="right">527</td>
<td class="xl77" align="right">1157</td>
<td class="xl75" align="right">846</td>
<td class="xl65" align="right">561</td>
<td class="xl77" align="right">614</td>
<td class="xl90" align="right">1062</td>
</tr>
<tr>
<td class="xl83" height="19">Profit/Loss</td>
<td class="xl72" align="right">0.832</td>
<td class="xl73" align="right">0.860</td>
<td class="xl73" align="right">0.825</td>
<td class="xl72" align="right">0.871</td>
<td class="xl73" align="right">0.890</td>
<td class="xl74" align="right">0.926</td>
<td class="xl72" align="right">0.871</td>
<td class="xl73" align="right">0.859</td>
<td class="xl74" align="right">0.804</td>
<td class="xl89" align="right">0.855</td>
</tr>
<tr>
<td class="xl83" height="19">Win Rate</td>
<td class="xl72" align="right">0.315</td>
<td class="xl73" align="right">0.348</td>
<td class="xl73" align="right">0.348</td>
<td class="xl72" align="right">0.250</td>
<td class="xl73" align="right">0.279</td>
<td class="xl74" align="right">0.116</td>
<td class="xl72" align="right">0.295</td>
<td class="xl73" align="right">0.335</td>
<td class="xl74" align="right">0.313</td>
<td class="xl89" align="right">0.550</td>
</tr>
<tr>
<td class="xl83" height="19">Expectation</td>
<td class="xl78" align="right">-0.422</td>
<td class="xl79" align="right">-0.353</td>
<td class="xl79" align="right">-0.364</td>
<td class="xl78" align="right">-0.532</td>
<td class="xl79" align="right">-0.474</td>
<td class="xl80" align="right">-0.777</td>
<td class="xl78" align="right">-0.448</td>
<td class="xl79" align="right">-0.377</td>
<td class="xl80" align="right">-0.435</td>
<td class="xl91" align="right">0.020</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Quantitative Finance, Technical Trading & Analysis. Fotis Papailias, Dimitrios Thomakos
<a rel="author" href="http://www.quantf.com/author/fotis-papailias">Fotis</a>
<a href="http://www.quantf.com">Quantitative Finance &amp; Technical Trading</a>
<a href="http://www.quantf.com/fotis-papailias/using-the-improved-ma-recent-feedback-and-further-instructions/397">Using the Improved MA: Recent Feedback and further Instructions!</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.quantf.com/fotis-papailias/using-the-improved-ma-recent-feedback-and-further-instructions/397/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
