+1 888 340 6572

MovAvg Adaptive Fltr

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

Download: MAAdaptiveFltr-STR.ela

File Includes:
Signal - MovAvg Adaptive Fltr
Function - AMAF

Category: Strategy > MovAvg Adaptive Fltr

Inputs:
Period
Pcnt

Description:

Signal MovAvg Adaptive Fltr ELA Code:
INPUTS: PERIOD(10), PCNT(.15);

VARS: AMAVAL(0), AMAFVAL(0), AMALS(0), AMAHS(0);

AMAVAL = AMA(PERIOD);
AMAFVAL = AMAF(PERIOD, PCNT);

IF CURRENTBAR = 1 THEN BEGIN
AMALS = AMAVAL;
AMAHS = AMAVAL;
END ELSE BEGIN
IF AMAVAL < AMAVAL[1] THEN
AMALS = AMAVAL;
IF AMAVAL > AMAVAL[1] THEN
AMAHS = AMAVAL;

IF AMAVAL - AMALS CROSSES ABOVE AMAFVAL THEN
BUY THIS BAR ON CLOSE;
IF AMAHS - AMAVAL CROSSES ABOVE AMAFVAL THEN
SELL THIS BAR ON CLOSE;
END;

{COPYRIGHT 1997 TECHNICAL ANALYSIS, INC.}