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

Re: Adaptive Moving Average Kauffman



PureBytes Links

Trading Reference Links

David,
Luca asked for K AMA, a derivative of AMA. CS was kind enough to give 
the code, see above reference
DT
--- In amibroker@xxxx, "David Holzgrefe" <dtholz@xxxx> wrote:
> Luca TJ has included AMA in Ami 
> 
> AMA - adaptive moving average (AFL 1.5) SYNTAX ama( ARRAY, 
SMOOTHINGFACTOR ) 
> RETURNS ARRAY 
> FUNCTION calculates adaptive moving average - simliar to EMA
() but smoothing factor could be time-variant (array). 
> EXAMPLE The example of volatility-weighted adaptive moving 
average formula:
> 
> graph0 = ema( close, 15 );
> fast = 2/(2+1);
> slow = 2/(30+1);
> dir=abs(close-ref(close,-10));
> vol=sum(abs(close-ref(close,-1)),10);
> ER=dir/vol;
> sc =( ER*(fast-slow)+slow)^2;
> 
> graph0 = ama( close, sc );
> 
> 
> 
> To find more info check the help file at the top of ami screen 
> 
> Regards David
> ----- Original Message ----- 
> From: Luca Meroni 
> To: amibroker@xxxx 
> Sent: Thursday, April 18, 2002 8:04 PM
> Subject: [amibroker] Adaptive Moving Average Kauffman
> 
> 
> Hi at all.
> I'm new with AB, but i find it very very good.
> The AFL language is very nice, and I try to learn it.
> I have the Adaptive Moving Average Kauffman formula for metastock:
> 
> 
> Periods := Input("Time Periods",1,1000, 10);
> 
> Direction := CLOSE - Ref(Close,-periods);
> 
> Volatility := Sum(Abs(ROC(CLOSE,1,$)),periods);
> 
> ER := Abs(Direction/Volatility);
> 
> 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
> 
> How can I tranlate in AFL ?
> 
> 
> 
> Thanks, Luca
> 
> 
> Yahoo! Groups Sponsor 
> ADVERTISEMENT
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service. 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.350 / Virus Database: 196 - Release Date: 4/17/2002