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

[EquisMetaStock Group] Re: ATR - True and Reverse



PureBytes Links

Trading Reference Links

{ Reverse True Range is the the *smallest*
  of the following for each period:
  * The distance from today's High
    to today's Low;
  * The distance from yesterday's Close
    to today's High;
  * The distance from yesterday's Close
    to today's Low.}


> Jose what does the Reverse part of the indicator used for?

KS, plot it and find out.  There are some interesting signals 
waiting to be found using this variation of ATR - somewhat similar 
to a low volatility range & breakout.


> What is the difference with you ATR and MS ATR? Thanks.

>From memory, I believe that MetaStock's ATR uses Wilder's smoothing.
I use the traditional exponential smoothing.

The differences are that, for example, a 20-period MS ATR is really 
using a 10-period exponential smoothing for the ATR.


====================
ATR - True & Reverse
====================
---8<--------------------------------

{ True, Reverse & MetaStock ATR v3.0 }
{ (c)Copyright 2004 Jose Silva }
{ http://www.metastocktools.com }

{ Reverse True Range is the the *smallest*
  of the following for each period:
  * The distance from today's High
    to today's Low;
  * The distance from yesterday's Close
    to today's High;
  * The distance from yesterday's Close
    to today's Low.}

{ user input }
plot:=Input("[1]True ATR,  [2]Reverse ATR,  [3]Both,  [4]MS-
ATR",1,4,1);
pds:=Input("Average True Range periods",
 1,252,10);
pdsN:=Input("normalizing periods (1=none)",
 1,2520,1);
smooth:=Input("Sine-weighted smoothing?  [1]Yes,  [0]No",0,1,0);

{ define True Range }
x1:=ValueWhen(2,1,C);
TrueRange:=Max(H-L,Max(Abs(x1-H),Abs(x1-L)));
RevTrueRange:=Min(H-L,Min(Abs(x1-H),Abs(x1-L)));

{ average True Range }
ATRtrue:=Mov(TrueRange,pds,E);
ATRrev:=Mov(RevTrueRange,pds,E);
ATRmeta:=Mov(TrueRange,pds*2-1,E);

{ normalize ATR }
ATRraw:=If(plot=1,ATRtrue,If(plot=2,ATRrev,
 If(plot=4,ATRmeta,ATRtrue)));
ATRnorm:=100*(ATRraw-LLV(ATRraw,pdsN))
 /(HHV(ATRraw,pdsN)-LLV(ATRraw,pdsN)+.000001);
ATRplot:=If(pdsN<2,ATRraw,ATRnorm);
rATRnorm:=100*(ATRrev-LLV(ATRrev,pdsN))
 /(HHV(ATRrev,pdsN)-LLV(ATRrev,pdsN)+.000001);
rATRplot:=If(pdsN<2,RevTrueRange,rATRnorm);

{ optional sine-weighted smoothing }
ATRplot:=If(smooth=1,(Sin(30)*ATRplot
 +Sin(60)*Ref(ATRplot,-1)
 +Sin(90)*Ref(ATRplot,-2)
 +Sin(60)*Ref(ATRplot,-3)
 +Sin(30)*Ref(ATRplot,-4))
/(Sin(30)*2+Sin(60)*2+Sin(90)),ATRplot);
rATRplot:=If(smooth=1,(Sin(30)*rATRplot
 +Sin(60)*Ref(rATRplot,-1)
 +Sin(90)*Ref(rATRplot,-2)
 +Sin(60)*Ref(rATRplot,-3)
 +Sin(30)*Ref(rATRplot,-4))
/(Sin(30)*2+Sin(60)*2+Sin(90)),rATRplot);

{ plot ATR }
If(plot=3,rATRplot,ATRplot);
ATRplot

---8<--------------------------------


jose '-)
http://www.metastocktools.com



--- In equismetastock@xxxxxxxxxxxxxxx, "formulaprimer" 
<formulaprimer@xxxx> wrote:
> Jose what does the Reverse part of the indicator used for?
> What is the difference with you ATR and MS ATR? Thanks.
> K.S.








------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/DldnlA/9M2KAA/U1CZAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

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

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

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