Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Moving Average to account for outliers Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
sundaypapertrading
Posted : Sunday, July 26, 2015 10:19:54 PM
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?

Bruce_L
Posted : Monday, July 27, 2015 3:31:21 PM


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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.