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

Re: Adaptive Moving Average System



PureBytes Links

Trading Reference Links

I coded the trading system described in the Bonus Issue 1998 of TASC, page
35. This system uses the Kaufman Adaptive Moving Average. I had not seen it
before.

I noticed that the description had some errors in the algebraic equations
but the Excel code seemed correct.

The attached ela file and code below contains both the system code and an
indicator that plots the significant parameters of the trading system so
you can see what is going on. Both are called "_KAMA" which will be found
near the top of the Open dialog after you transfer in the ela file.

The function "_AMA" is the moving average posted earlier today. One note:
If you compile the "_AMA" function as posted, you must name the function
exactly "_AMA" or it will not compile. If you want to change the name, you
need to change the code to correspond.

The results of the system are not bad. I found that values of the "filter
percent" "FiltrPct" needed to be higher than 15 for decent results.

Hope this is useful.

Bob Fulks


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

   System       : _KAMA

   Last Edit    : 1/4/98

   Provided By  : Bob Fulks

   Description  : This system uses the Kaufman Adaptive Moving
      Average. It is an EasyLanguage version of the system
      published in the Bonus Issue 1998 of TASC, page 35.
      Note that the article description has errors in the
      algebraic equations but the spreadsheet formulas seem
      to be correct.

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

Inputs: Length(10), FiltrPct(15);

Vars: AMA(Close), Filter(0), AMAlo(Close), AMAhi(Close);

AMA = _AMA(Close, Length);

Filter = FiltrPct * StdDev(AMA - AMA[1], Length) / 100;

AMAlo = iff(AMA < AMA[1], AMA, AMAlo[1]);
AMAhi = iff(AMA > AMA[1], AMA, AMAhi[1]);

if AMA - AMAlo > Filter then Buy;
if AMAhi - AMA > Filter then Sell;



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

   Indicator   : _KAMA

   Last Edit   : 1/4/98

   Provided By : Bob Fulks

   Description : This indicator uses the Kaufman Adaptive
      Moving Average. It is an EasyLanguage version of an
      indicator showing the parameters of the system published
      in the Bonus Issue 1998 of TASC, page 35. Note that the
      article description has errors in the algebraic equations
      but the spreadsheet formulas seem to be correct.

      See the system called _KAMA also.

      Properties Settings: Should be plotted "Same as Price Data"

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

Inputs: Length(10), FiltrPct(15);

Vars: AMA(Close), Filter(0), AMAlo(Close), AMAhi(Close);

AMA = _AMA(Close, Length);

Filter = FiltrPct * StdDev(AMA - AMA[1], Length) / 100;

AMAlo = iff(AMA < AMA[1], AMA, AMAlo[1]);
AMAhi = iff(AMA > AMA[1], AMA, AMAhi[1]);

Plot1(AMA,   "KAMA");
Plot2(AMAhi - Filter, "KAMA+");
Plot3(AMAlo + Filter, "KAMA-");



Attachment Converted: "c:\eudora\attach\KAMA.ELA"--
Bob Fulks
bfulks@xxxxxxxxxxxx