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

Re: Adaptive Moving Average System


  • To: "Steve Duval" <dmii@xxxxxxxxxxxxx>
  • Subject: Re: Adaptive Moving Average System
  • From: Bob Fulks <bfulks@xxxxxxxxxxxx>
  • Date: Sun, 4 Jan 1998 06:57:07 -0800 (PST)
  • In-reply-to: <01bd187c$70d8a720$5602b8cd@xxxxxxxxx>

PureBytes Links

Trading Reference Links

>In the latest issue of Stocks & Commodities,  Perry Kaufman talks about
>his AMA. I am interested in this trading system and  wonder if anyone has
>put this into a trading system and as an indicator for  SuperCharts 4.0?
>Also, any comments relative to this system would be much  appreciated. By
>the way, Happy New Year! Steve

The Kaufman AMA ela file is attached. It is coded as a function called "_AMA"

Bob Fulks


{***********************************************************

Name : Adaptive Moving Average Function

Notes: From "Smarter Trading" by Kaufman

Desc : An exponential moving average in which the smoothing
       factor varies with the "efficiency ratio". Efficiency
       ratio is the ratio of total price excursion divided by
       the sum of all individual excursions of each bar. It
       equals 1.0 if all moves are in one direction over the
       lookback period.

By:    Bob Fulks based upon code and descriptions in
       Kaufman's book with:

       > Price input added



************************************************************}


Inputs:   Price(NumericSeries),    {Price which is averaged}
          Period(NumericSimple);   {Lookback period}

Vars:     Noise(0),          {Sum all individual excursions}
          Signal(0),         {Total excursion over period}
          Diff(0),           {Individual price excursions}
          EfRatio(0),        {Efficiency Ratio}
          Smooth(1),         {Smoothing factor}
          Fastend(0.666),    {Shortest smoothing}
          Slowend(0.0645),   {Longest smoothing}
          AMA(0);            {Adaptive Moving Average}

Diff = AbsValue(Price - Price[1]);

if CurrentBar < Period then
   AMA = Price
else begin
   Signal  = AbsValue(Price - Price[Period]);
   Noise   = Summation(Diff, Period);
   EfRatio = IFF (Noise <> 0, Signal / Noise, 0);
   Smooth  = Power(EfRatio * (Fastend - Slowend) + Slowend, 2);
   AMA     = AMA[1] + Smooth * (Price - AMA[1]);
end;

   _AMA    = AMA;




--
Bob Fulks
bfulks@xxxxxxxxxxxx