+1 888 340 6572

AMA

Article/Author: “A Guide to Smarter Trading”, Perry Kaufman, S&C Magazine, Traders Tips, 03/1998

Download: FUNCTION-AMA.ELA

File Includes: Function - AMA

Category: Function > AMA

Description:

Inputs:
Period -

EasyLanguage Code:
INPUTS: PERIOD(NUMERIC);

VARS: NOISE(0), SIGNAL(0), DIFF(0), EFRATIO(0), SMOOTH(1), FASTEST(.6667), SLOWEST(.0645), ADAPTMA(0);

DIFF = ABSVALUE(CLOSE - CLOSE[1]);
IF CURRENTBAR <= PERIOD THEN ADAPTMA = CLOSE;
IF CURRENTBAR > PERIOD THEN BEGIN
SIGNAL = ABSVALUE(CLOSE - CLOSE[PERIOD]);
NOISE = SUMMATION(DIFF, PERIOD);
EFRATIO = SIGNAL / NOISE;
SMOOTH = POWER(EFRATIO * (FASTEST - SLOWEST) + SLOWEST, 2);
ADAPTMA = ADAPTMA[1] + SMOOTH * (CLOSE - ADAPTMA[1]);
END;

AMA = ADAPTMA;

{COPYRIGHT 1997 TECHNICAL ANALYSIS, INC.}