Dr PhilAll moving averages have to be based on a backward looking window of time. So a 10 day average is the average of the last 10 days and so on. But the center in time for that average is really about five days ago. To be more precise it is (n+1) / 2 days ago or 5.5 days ago.

So comparing two moving averages of different lengths is really comparing apples and oranges. If we compare a 10 day to a 30 day average, for example, then we are comparing the average of 5.5 days ago to 15.5 days. In other words they are not the same point in time. Mr. Glazier's enlightening 3D representation of moving averages of various lengths shows that the longer windows respond more slowly to ripples in price than do the shorter moving averages because of this lag effect.

Another feature visible in the chart is the apparently cyclical undulations. The problem with that is that it may simply be a manifestation of the Slutzky - Yule effect. Essentially Slutksy-Yule says that any series, when averaged, will show sinusoidal oscillations as a result of the averaging process. This is true even if the original series was composed of random numbers which could not possibly be sinusoidal in nature.

Another common pitfall when using moving averages is to think that all one has to do is to find the magic combination such as a 19, 27 and 79 day triple crossover with a minimum threshold of 1%. The problem with any such system is that there are an infinite number of these combinations. We quickly fall into the data mining trap where we will appear to find something even if it is merely a product of chance.

Dr. McDonnell is the author of Optimal Portfolio Modeling, Wiley, 2008

Yishen Kuik adds:

Another interesting point about moving averages is that the daily change in an N period moving average is caused by the difference between the values of the Nth day and the current day:

MA(t) = (1/N) * ( p(t) + p(t-1) + … + p(t-N+1) )

MA(t) - MA(t-1) = (1/N) * ( p(t) - p(t-N) )

So in cases where N is small, and where the p(t-N) value that fell out of the calculation is large, the moving average can experience sudden drops. This causes that cognitive dissonance when one sees a moving average fall even as the values are climbing between yesterday and today.This also provides the intuition to Slutzky Yule - for any given set of observations, there exists a cluster of points that has the highest average of all similar sized clusters, so while that cluster is passing through the calculation period of the moving average, there will be a peakedness, with two troughs surrounding it.

Alice Allen remarks:

While we’re talking about moving averages, a practical caution from my own experience with a popular commercial trading platform: If you are in a fast trading situation, monitoring a price graph with less than a 1-day display unit (e.g., 60-min, 30-min, 15-min), a line labeled “200-Day Moving Average Study” may not be the true 200-Day MA but perhaps the MA of the last 200 ticks. Under these circumstances, you may visually note that the price has crossed your MA line, but it will not necessarily be a true MA crossover as calculated by programs. Maybe this is obvious, but it took me a while to figure out and perhaps is unique to the platform I use.

Anatoly Veltman writes:

The best use of MAs that I know has nothing to do with crossovers. And it happens to be essential to one’s daily/weekly chart perspective. Extremely useful! I first saw it described by Stan Weinstein; then the periods and trading signals were optimized by a few proprietary shops. I believe it to be one of the better tools; if not for all markets, then at least for stocks.





Speak your mind

3 Comments so far

  1. Andrew on September 28, 2008 11:05 am

    This surely applies to simple moving averages, but what about the other methods of calculating averages?

  2. Matt Johnson on September 30, 2008 12:44 pm

    The GOOD thing about moving averages is they get you in late, the BAD thing about moving averages is they get you in late.

  3. douglas roberts dimick on October 4, 2008 1:04 pm

    In Memory of Donald: A Concurrence to Evgeny Slutzky and Moving Averages, from Phil McDonnell

    After seven years of R&D, program design and engineering, coding and beta testing (with Tradestation since 2003), I find Phil’s observation both a` propos (for this September) and to underscore the systemic flaw of contemporary modeling among those program trading, mathematical systemites of speculation.

    The debut of my theorem (“quantitative relativity”) last October ( presents consideration for a paradigm shift, away from fundamental (quant) derivation within the program trading industry. In the study of law, we consider how procedure affects (and effects) substantive determination. Analogous here is how contemporary quantitative foundations for program frameworks codify strategic (output) positions, thereby recognizing artificial exchange (state) constructs that are not necessarily market (input) realizations.

    The positing of quantitative relativity concludes that (physics) laws governing the relativity of (non)directional energy – and, therefore, human applications, as may be embedded within stochastic rule-based protocols – precedes and thereby subsequently determines the import of quantitative calculation(s) measuring price action generated (or transferred) during any given market exchange process.

    Observed in the article: “Consider a reported finding by two MIT theorists; their research concluded that optimized programs had not failed during recently publicized (quant fund) losses but simply did not factor in non-programmed corresponding market (sell-off) anomalies. Is that deduction actually evidencing that quantitative frameworks require inductive integration?”

    A distinctive ego-centricity has been imbued from/within/throughout quant parlance to date – at least prior to September. As if markets are governed and therewith directed by prospective constructs, so recognized and prognosticated with “optimized programs” any more so than they are staged with moving averages?

    Masters of the Universe, bully-bully…

    Programmatic adaptation of quantitative relativity as a theorem –the SMART (securities market automated relativity trading) algorithm – experienced a significant advancement with elimination of moving averages from its programming code. Since March of 2007 (having resolved program strategy conflicts between parallel indicator processing and function integration, thereafter commencing design of a system execution protocol), when I found myself inserting a moving average, I thereby assumed that my related formulation was flawed. Thus, SMART has no moving averages. Why?

    Phil’s example — 10 days relative to 5 days of averaging functions — is demonstrative of the quantitative inversion of behavioral transference as so displayed during any given electronic market exchange process. Whereby statistical correlation of exchange dynamics (given Phil’s example) for 10 days presents assimilated input (or patterning), generated output presents mathematical states for stochastic applications, which may be comparatively as random during 5 days as they could be nominative indications of 10 days; moreover, such numeric modeling presents variant output production from input anomalies that thereby parallel any corresponding range of optimized states.

    Thank you, Slutsky – and Phil, as I was unaware of his theorem. As a juris doctorate thinking he is forever cast to be a metonym dismissed within a PhD entrancement, how assuring to find a doctor of law articulating a parallel plane of inquiry (i.e., “that the moving average of a random series may generate oscillatory movement when no oscillations exist in the original data”).

    I read VN’s prognostications (with or without prognosticativability) and often reflect upon Sol’s pre- and post-cautionary advisements to Max “identifying” a string of (216) digits for potentially discerning order from chaos. In that movie (Pi) and in Phil’s article (a la the data mining trap), we are queried as to when and where do we cease being mathematical and become reduced to numerology (or numbers-theory)? Thus the game of Go (played in the movie by Sol and Max) may be then viewed here as being synonymous with program trading, given industry applications, for example, of moving averages, whereby arithmetic calculations are actually relative to the variables of any given data set.

    Perhaps Phil says it best: “The problem with any such system is that there are an infinite number of these combinations.”

    My father, upon diagnosis of and with the advancement in his progressive condition of Alzheimer’s, would use the word “system” to describe that chaotic presentment of living with daily challenges. To his credit, he overcame the disease though a realignment of his automated flow charting of human functioning (or states-inputs-outputs as transitioned by states-inputs-states) predicated on acceptance and accommodation. Doing so, he lived with me for another 11 years.

    Donald L. Dimick faced chaos with humor, music, and a trending affability, thereby maintaining an order of self even as his identity fluctuated as chaotically at times as current day markets.

    And the moving averages up to and through this time in his life –until one October morning we fell asleep, me with my head on his shoulder, only for me to wake without him some 30 minutes later?

    What Dad taught me and so left with me was the knowing that it is not any given measure – or quantification, if you will – but it is one’s quality. It is the state of being.

    It is relative…

    His son


Resources & Links