Rank: Newbie
Groups: Registered, Registered Users Joined: 3/1/2010(UTC) Posts: 1
|
Hi
Does the standard metastock ATR (Average True Range) use a simple moving average or an exponential one. I wanted the latter if possible.
If it is a simple one how do you do an exponential one ?
Would this be correct to calculate a 20 day Exponential ATR.
MOV(ATR(1),20,E) ?
Many thanks
David
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users Joined: 11/7/2005(UTC) Posts: 602
|
Off of the internet ATR is: periods:=Input("ATR Periods?",1,100,10);
TH:=If(Ref(C,-1) > H,Ref(C,-1),H);
TL:=If(Ref(C,-1) < L,Ref(C,-1),L);
TR:=TH-TL;
Wilders(TR,periods) Which is a modified EMA. See: http://trader.online.pl for more free code.
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 7/25/2005(UTC) Posts: 1,042
Was thanked: 57 time(s) in 54 post(s)
|
Hi David
As John has said the standard ATR() function uses Wilders Smoothing as the smoothing element. This is a slower MA than an ordinary EMA, but still exponential in nature. Your Mov(ATR(1),20,E) suggestion is the correct way of applying the standard EMA smoothing method to an ATR. You can also choose any one of several other smoothing methods if you wish to.
An N periods Wilders() is the equivalent of a 2*N-1 periods EMA. A 10 period Wilders() gives essentially the same result as a 19 period EMA, though Wilders is seeded differently from an EMA and resul;ts are are little different for say the first 50 to 100 bars of my example.
Roy
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
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.