[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Metastockusers] Re: ATR - how to make it better?



PureBytes Links

Trading Reference Links

Jose and others,

Keeping aside the point how MS calculates ATR, the fact is that ATR is an 
extremely volatile indicator - its value (over, say, 20 bars) can range from 
a low of zero (theoretically) to several times what its average value for 
that period might be. e.g. a 20-bar ATR, as calculated by MS, may be 1.5 and 
the ATR(1) range over those 20bars might be 0.2 - 5.8!!! Clearly, some form 
of averaging needs to be used to come up with a workable number - one can 
use simple, exponential, weighted, etc. - the latter two will make it more 
sensitive to recent values.

When a stock is not trending steeply, one can use any form of averaging - 
their value will tend to be clustered closely. However, when a stock is in a 
steep rise or decline, the simple avarage will underestimate the "true" ATR 
in an uptrend and overestimate it in a downtrend. Lest one think that one 
should therefore use Wtd or Expo averages, it should be noted that a large 
ATR value for the last bar will unduly influence them. One can see the 
results visually by plotting the ATR values in a chart - just calculate and 
plot the 20bar simple, expo, and wtd ATRs and one can appreciate their 
clustering in a nontrending stock and the generally more volatile nature of 
Expo & Wtd ATRs.

I have struggled with the problem of getting a "reasonable" value for the 
20-period ATR for quite some time now, in the process concocting some 
(strange) formulas that would "dampen" the fluctuations in its value. My 
current thinking is that I should be using Standard Deviation of the 
20-period mean (simple average) in some fashion. Since I don't have a PhD in 
mathematics, I have been stuck.

Can you think of a formula to implement std dev (or some other mathematical 
function) to calculate the 20-period ATR, and in the process weeding out the 
"outlying values" (both high and low)? Any help will be appreciated.

JD
=========================================
From: "Jose" <josesilva22@xxxxxxxxx>
Reply-To: Metastockusers@xxxxxxxxxxxxxxx
To: Metastockusers@xxxxxxxxxxxxxxx
Subject: [Metastockusers] Re: ATR - True & Reverse
Date: Sat, 28 Feb 2004 02:31:50 -0000

Peter and others,

Whilst the EMA has influences beyond its intended lookback period, its
periodicity approximates SMA periodicity - it is not out by a factor
of two as in the MS ATR smoothing.

"I don't agree with the thinking behind the statement "should be .. an
average of the True Range over 10 periods" for the following reason."

In that case you are in disagreement with MetaStock Help:
"The Average True Range is simply the average of the true ranges over
the past x periods (where x is specified by the user)"

The MS Average True Range is simply *not* the average of True Ranges
over the past x periods.  As used in MS, it is a smoothing mechanism
that in effect averages the True Range over almost twice the user's
intended lookback periodicity.


jose '-)


--- In Metastockusers@xxxxxxxxxxxxxxx, "Peter Kuskopf" <pkuskopf@xxxx>
wrote:
 > We could argue that Wilders should have used a slightly different
name for his indicator, but I guess an inventor has the prerogative.
 >
 > I don't agree with the thinking behind the statement "should be ..
an average of the True Range over 10 periods" for the following
reason.
 >
 > Both Wilders and Exponential smoothing contain influences from
further back than the nominated periods. That is, "periods" is a
damping factor, not a limitation on the data to be included in the
calculation. There are probably many other indicators where the term
"periods" is used loosely in this way.
 >
 > I think it's just another little fact that we need to remember
if/when transferring code between trading platforms, Wilders original
definition of ATR used his own method of smoothing which probably
pre-dated computer calculation of the current common definition of an
EMA.
 >
 > At various times, I have used 3 different measures of volatility,
ATR(n), SMA(ATR(1),n), and EMA(ATR(1),n), and in my systems, I always
adjust "n" to sit inside a range of robust optimised values. I've
never noticed much difference between the variants when compared
against the differences caused by my own inadequacies.
 >
 >
 > Peter
 >
 >
 > ----- Original Message -----
 >   From: Jose
 >   To: Metastockusers@xxxxxxxxxxxxxxx
 >   Sent: Friday, February 27, 2004 8:44 PM
 >   Subject: [Metastockusers] Re: ATR - True & Reverse
 >
 >
 >   Hi Roy,
 >
 >   Leaving Exponential Moving Averages aside for the moment, it's my
firm
 >   belief that any x-period averaging mechanism should do exactly
what it
 >   says.
 >   Again, it's my opinion that regardless of what Mr Wilder intended
in
 >   the application of Average True Range (ATR), a 10-period ATR
should be
 >   just that: an average of the True Range over 10 periods.
 >
 >   The way ATR is implemented in MetaStock, a 10-period ATR is an
 >   exponential average of the True Range over 19 periods:
 >   ATR(10)=Mov(ATR(1),19,E)
 >
 >   As Bill pointed out in the previous post, TradeStation computes
the
 >   correct simple average of True Range over x periods.
 >
 >   How many of us thought until now, that we were using a 19-period
 >   average of the True Range in ATR(10)?
 >
 >   In reality, using a Average True Range of x periods when we are
led to
 >   believe it's an average over (x+1)/2 periods, is simply
misleading.
 >   Why not call the smoothing something else rather than "periods"?
 >
 >   The key word here is "Average" and its definition.
 >   Let's call a spade, a spade.
 >
 >   jose '-)
 >
 >
 >   --- In Metastockusers@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxxx>
 >   wrote:
 >   > Hi Jose
 >   >
 >   > > Whilst coding the True/Reverse ATR indicator below, I've
noticed
 >   that
 >   > > MetaStock Pro v8.01 smooths ATR's erroneously.  The MS
exponential
 >   > > smoothing is based on periods*2-1.
 >   >
 >   > The "periods*2-1" ratio is that used by Wilders Smoothing, the
form
 >   of exponential moving average
 >   > used in a number of indicators developed by Wilder.
 >   >
 >   > See the following code for similarities and differences. Notice
that
 >   Wilders Smoothing is seeded by
 >   > a Simple Moving Average for "n" periods while the EMA is seeded
on
 >   bar one by the value of the data
 >   > array being smoothed. The EMA code below does not have any N/A
plot
 >   (this can be created easily
 >   > enough) but it is still true to the standard MetaStock EMA.
 >   >
 >   > Since Wilder iss the author of the "Average True Range"
indicator I
 >   would think that Wilders
 >   > Smoothing is the intended form of smoothing. Of course I could
be
 >   wrong as you have seen more than
 >   > once in the past.
 >   >
 >   >   {Exponential Moving Average}
 >   > n:=Input("Periods",1,999,10);
 >   > R:=2/(n+1); {ratio of new data added each bar}
 >   > If(Cum(1)=1,C,PREV*(1-R)+C*R);
 >   >
 >   >   {Wilders Smoothing}
 >   > n:=Input("Periods",1,999,10);
 >   > R:=1/n; {ratio of new data added each bar}
 >   > If(Cum(1)<=n,Mov(C,n,S),PREV*(1-R)+C*R);
 >   >
 >   > Roy

_________________________________________________________________
Click, drag and drop. My MSN is the simple way to design your homepage. 
http://click.atdmt.com/AVE/go/onm00200364ave/direct/01/



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/Metastockusers/

<*> To unsubscribe from this group, send an email to:
     Metastockusers-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/