markd01 10 posts msg #98099 - Ignore markd01 |
12/18/2010 8:52:35 PM
Does anyone know how to apply Wilders Smoothing to Average True Range (ATR) formula in StockFetcher?
One reference to Wilders Smoothing is found here:
http://www.moneytec.com/forums/f46/wilders-smoothing-15370/
explaining that:
"The formula for an n-period Wilder's smoothing average is WSA = EMA(2n-1)"
Here's what I did so far in StockFetcher, but it still does not match up to Wilder's Smoothed ATR values found elsewhere:
set {SimpleATR16, atr(16)}
set {WildersATR16, CEMA (SimpleATR16, 31)} /* take simple atr where n=16, then apply exponential moving average for 2n-1*/
set {WildersATR16P1, WildersATR16/Close}
set {WildersATR16Percentage, WildersATR16P1 * 100}
add column SimpleATR16
add column WildersATR16
add column WildersATR16Percentage
|
miko 68 posts msg #98102 - Ignore miko |
12/18/2010 11:41:53 PM
The first issue to resolve was whether the ATR indicator already incorporated the smoothing (after all, that's how the original was created, but for no other reason than ease of mechanical calculation). The following displays the atr indicator, a 16 day simple average of the 1 day atr, and a 31 day exponential average of the 1 day atr:
Guess that answers everything, the indicator is a simple average, and the last -- cema(atr(1),31) -- produces the smoothed atr (a 31=n*2-1 day exponential average of the 1 day average true range.
|
markd01 10 posts msg #98106 - Ignore markd01 |
12/19/2010 12:30:42 AM
Thanks, miko!
The bottom line is that simple atr(16) translates to Wilder's smoothed CEMA (atr(1), 31), which works for me...
|