PureBytes Links
Trading Reference Links
|
Luca TJ has included AMA in Ami
AMA -
adaptive moving average (AFL 1.5)
SYNTAX
<FONT
color=#ffffff>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 = <FONT
color=#ffffff>ama( close, sc );
To find more info check the help file at the top of
ami screen
Regards David
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Luca
Meroni
To: <A title=amibroker@xxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
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 tryto 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
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
<BLOCKQUOTE
><FONT
face="Courier New">---Outgoing mail is certified Virus
Free.Checked by AVG anti-virus system (<A
href="">http://www.grisoft.com).Version: 6.0.350
/ Virus Database: 196 - Release Date:
4/17/2002
|