Registered User Joined: 8/30/2012 Posts: 11
|
Hello, I'd like to make a PCF of a moving average that accounts for outliers. As you know a single abnormal move in a stock can throw off a moving average dramatically. I'd like to account for that by doing the following:
21 day SMA
Sort all 21 days and determine the median of the 21 days
Exclude any values that are Median + (1.5x the Median) and Median - (1.5x the Median) so I can normalize the moving average.
For example on a 7-day Moving Average the values could be as follows:
12, 15, 13, 9, 19, 46, 14
Sorted these daily closes would be:
9,12,13,14,15,19,46
The median is 14
(1.5x the Median + Median) = 38
(1.5x the Median - Median) = -7
46 would be tossed out so the 7-day SMA would simply be:
9+12+13+14+15+19 / 6
Is this possible or is there a way to exclude outliers from the SMA calculations?
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
There is not a good way to calculate this. Everything I can think of would result in an Indicator Formula which would be way too long and slow to be practical or post in the forums.
I cannot think of a non-formula based way to do this by using change data source to chain together multiple indicators either.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|