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

Re: Kaufman question



PureBytes Links

Trading Reference Links

I think I put this together from Kaufman's 1995 book "Smarter
   Trading"  These Vars: are for slow, change to fastend(.666) and
   slowend(.645) for normal and fastend(.666) and slowend(.039)for
   fast.  Hope it helps.

   Grover Ericksen

{AdaptMovAvg(Indicator)   by Kaufmann   }

                INPUTS: Period(10);
                
                Vars: Noise(0),signal(0),diff(0),efratio(0),smooth(1), fastend(.25),slowend(.022), AMA(0);
                
                Diff = AbsValue(Close-Close[1]);
                
                If(CurrentBar <= Period) then AMA = Close;
                
                If(CurrentBar > Period) then begin
                
                         Signal = AbsValue(Close - Close[Period]);{absolute value of momentum}
                     
                         Noise = Summation(Diff,Period);
                     
                         efratio = signal/noise;

                     Smooth = Power(efratio*(fastend-slowend) + slowend,2);
                     
                AMA = AMA[1] + smooth*(Close - AMA[1]);
                
                Plot1(AMA,"AMA");
                End;