Фильтр АМА Кауфмана для Omega TradeStation

12 апреля, 2011

Inputs: Period(10);

Vars: Signal(0), Noise(0), Diff(0), ER(0), Smooth(1), Fastest(.6667), Slowest(.0645), AMA(0);

Diff = AbsValue(Close — Close[1]);

IF CurrentBar <= Period Then AMA = Close;

IF CurrentBar > Period Then Begin

Signal = AbsValue(Close — Close[Period]);

Noise = Summation(Diff, Period);

If Noise > 0 then ER = Signal / Noise;

Smooth = Power(ER ∗ (Fastest — Slowest) + Slowest, 2);

AMA = AMA[1] + Smooth ∗ (Close — AMA[1]);

End;

Plot1( AMA, «AMA»);

Фильтр АМА Кауфмана для Metastock

12 апреля, 2011

Periods:= Input(» Periods»,1,1000, 10);

Signal:= CLOSE — Ref(CLOSE,-periods);

Noise:= Sum(Abs(ROC(CLOSE,1,$)),periods);

ER:= Abs(Signal/Noise);

FastSC:= 2/(2 + 1);

SlowSC:= 2/(30 + 1);

SSC:= ER ∗ (FastSC — SlowSC) + SlowSC;

Constant:= Pwr(SSC,2);

AMA:= If(Cum(1) = periods+1, Ref(CLOSE,-1) + constant ∗ (CLOSE — Ref(CLOSE,-1)),PREV +

Constant ∗ (CLOSE — PREV));

AMA