Black Friday great discounts start today Learn more
+1 888 340 6572

AMAF

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

Download: FUNCTION-AMAF.ELA

File Includes: Function - AMAF

Category: Function > AMAF

Description:

Inputs:
Period -
Pcnt -

EasyLanguage Code:
INPUTS: PERIOD(NUMERIC), PCNT(NUMERIC);

VARS: NOISE(0), SIGNAL(0), DIFF(0), EFRATIO(0), SMOOTH(1), FASTEST(.6667), SLOWEST(.0645), ADAPTMA(0), AMAFLTR(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]);
AMAFLTR = STDDEV(ADAPTMA-ADAPTMA[1], PERIOD) * PCNT;
END;

AMAF = AMAFLTR;

{COPYRIGHT 1997 TECHNICAL ANALYSIS, INC.}