Skip to content

A Quick Tip to Improve Moving Averages

November 11, 2009

Note that the “C” in CSS does not stand for “Countertrend” and I have spent plenty of time the last 2 months working on trend indicators and refinements. The essence of my evolving adaptive markets philosophy is to be agnostic with respect to trend or countertrend. That said, I have produced very little  published work so far on the former. Expect a whole new class of indicators in the months to come. Here is a simple method i have found extremely useful in cleaning up moving averages:

1) Take all price moves that are in the 90th or 95th and 10th or 5th percentile out of the data used for calculating the moving average especially if they represented unusual gaps.

2) The more recently these “outliers” occur, the more you have to weight current data to speed the average up to account for omissions. Thus exponential weighting is preferable if a large portion of a recent move was eliminated.

The Result: better moving averages with less trades and less false signals!

6 Comments leave one →
  1. November 12, 2009 8:13 am

    What are the percentiles based on? Daily Range, True Range, Historica Volatility?

    • david varadi permalink*
      November 12, 2009 10:53 am

      hi Joshua, good question, i take the average of the O,H,L,C and
      divide it by the previous day’s close. I then take the 200 day
      percentile of this value.

      cheers
      dv

  2. quant permalink
    November 12, 2009 8:59 am

    I’d feel uncomfortable with just eliminating large price moves — they did happen –, but an alternative could be to cap them. For example, all price moves above 3% (below -3%) could be reduced to 3% (-3%).

    • david varadi permalink*
      November 12, 2009 9:48 am

      hi, you are right—capping them is a good solution, for longer moving averages the effect is negligible. i think for individual stocks that take huge one day gaps, your solution is most important as this gap can define the course of the new trend.
      cheers
      dv

      • Josh permalink
        June 9, 2010 2:02 am

        Hi David,

        I’m trying to wrap my head around a relatively efficient way to program this but all I come up with is some pretty clunky code. Can you explain how you calculate this in more depth? Especially the part about weighting recent data relative to outlier removal.

        Thanks!

      • david varadi permalink*
        June 9, 2010 2:09 am

        hi josh, i cant give you a sample sheet that i have handy for this but i recommend imagining that you created a “bin” that contained a price array for creating a moving average that was re-created with each passing day. this bin —versus a price column in excel which cannot achieve this task—can be sorted or worked with to do the tasks discussed.

        best
        david

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: