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!

1. November 12, 2009 8:13 am

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

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

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%).

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

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!