Sunday, December 4, 2011

Improved Moving Average?

I have been notified by the authors that the code does not perfectly reflect the improved moving average introduced.  In another post, I will explore the differences.  The authors have now released their version of the code http://www.quantf.com/fotis-papailias/improved-moving-average-code-is-available-for-download/332.

When @quantfblog started following me on Twitter, I was delighted to discover their papers

Papailias, Fotis and Thomakos, Dimitrios D., An Improved Moving Average Technical Trading Rule (September 11, 2011). Available at SSRN: http://ssrn.com/abstract=1926376

Papailias, Fotis and Thomakos, Dimitrios D., An Improved Moving Average Technical Trading Rule II - Can We Obtain Performance Improvements with Short Sales? (November 12, 2011). Available at SSRN: http://ssrn.com/abstract=1958906

backed by a nice and improving website http://www.quantf.com.  I just could not resist the opportunity to port their improved moving average idea to R and run some additional tests.  The entire process was extremely pleasant due to the authors’ willingness to test, comment, and suggest throughout the implementation process.  Thanks so much to them for all their help.

In this process, I AM NOT OFFERING INVESTMENT ADVICE.  THIS IS SIMPLY A TEST/ILLUSTRATION.  PURSUING THESE CONCEPTS WILL MOST LIKELY LOSE SIGNIFICANT AMOUNTS (ALL) OF YOUR MONEY.

 

From TimelyPortfolio
From TimelyPortfolio
From TimelyPortfolio

For fun, I thought it would be interesting to compare the "Improved Moving Average" to a Mebane Faber style 10-month moving average system.

From TimelyPortfolio

 

While I enjoyed the testing, I am still not entirely sure if the “improved moving average” is significantly improved, but it certainly might fit someone’s utility curve better than the standard moving average.  More than anything, this process has proven to me a couple of things:

1) the beauty of open-source and collaboration.  The authors were incredibly generous and helpful as I worked through this process.  To even better demonstrate the power of open-source, I will use ttrTests to do additional testing and then the bt examples from http://systematicinvestor.wordpress.com in future posts.

2) how even a simple moving average can become incredibly complex.  Making one very slight change markedly changes the results.

R code from GIST:

 

3 comments:

  1. Dear Kent,

    Thank you very much for all your kind words. Unfortunately the code contains some minor mistakes and needs further debugging (that's causing the method to underperform).

    I will send you an e-mail today and I will also post another code on my blog. Thanks, Fotis

    www.quantf.com

    ReplyDelete
  2. Really, Awesome blog you have post here. Thanks for sharing this info...

    http://www.pennystockshark.com/

    ReplyDelete
  3. Nice blog. Thank you for sharing. ASHOKA PACKERS AND MOVERS is well established reputed and professionally managed company having own branches and network all over India.

    Packers and Movers Hyderabad

    Packers and Movers Gurgaon

    Packers and Movers Pune

    Packers and Movers Delhi

    Packers and Movers Bangalore

    ReplyDelete