logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
dklugmann2  
#1 Posted : Monday, March 1, 2010 4:16:09 PM(UTC)
dklugmann2

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
johnl  
#2 Posted : Monday, March 1, 2010 6:54:30 PM(UTC)
johnl

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.

mstt  
#3 Posted : Monday, March 1, 2010 11:31:01 PM(UTC)
mstt

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.