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

Re: [amibroker] MS PREV



PureBytes Links

Trading Reference Links


Hi,
 
As I wrote in a separate e-mail you need an AMA 
function to write your formula in AFL.
PREV function in your example is used to implement 
variable-period exponential moving
average - it is exactly what AFL's AMA 
does.
 
The difference between PREV and Ref( something, -1 
) is important because
PREV gives previously generated value of the 
indicator enabling recurrent formulas like
 
value[ n ] = somefunction( value[ n - 1] 
)
 
Best regards,Tomasz Janeczko===============AmiBroker - the 
comprehensive share manager.<A 
href="">http://www.amibroker.com
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
Bernard 
Bourée 
To: <A title=amibroker@xxxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 
Sent: Sunday, June 10, 2001 5:05 
PM
Subject: Re: [amibroker] MS PREV

Steve
 
 I must admit that I am not sure that I have 
fully understand the difference between the MS PREV function and the Ref(xx, 
-1).
In your translation of my code you have replaced 
PREV by Ref() function.
Are you sure that is correct ?
 
Bernard Bourée<A 
href="">bbouree@xxxx
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
Steve Wiser 

To: <A title=amibroker@xxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Sunday, June 10, 2001 12:59 
PM
Subject: Re: [amibroker] MS PREV
Bernard:Will this work for you.  Remember as you 
cut and paste, put this into notepad first to get the line breaks right. 
Then cut and paste that into Amibroker.  This appears to indicate when 
a change in price direction may be eminent.Steveaa = C - 
Ref(C,4);bb =   Sum(Abs( C - ref(C,-1)  ) ,4  
);                     
/*Sum(Abs(ROC(C,1,$)),4);*/cc = (Abs((AA)/BB));dd = 
((2/3)-(2/31))+(2/31);ee = ( CC*DD)^2 ;ff  =  
(C-Ref(C,-1));/*{Sig:= If( Cum(1) = 5,     
Ref(C,-1)+EE*FF, PREV + EE * (C - PREV));}*/var1 =   ee*ff+ 
Ref(C,-1);var2  =  Ref(var1,-1)+EE*(C - Ref(var1,-1) 
);var3  =   IIf( Cum(1) == 5 , var1, var2);Graph1 = 
var3;At 08:44 AM 6/10/01 +0200, you wrote:
Hi Tomasz 
and Steve, Thank you for your 
reply.Here is my 
formula: aa= C - 
Ref(C,4);<FONT face=arial 
size=2>bb=Sum(Abs(Roc(C,1,$)),4)<FONT face=arial 
size=2>cc=(Abs((AA)/BB))<FONT face=arial 
size=2>dd=((2/3)-(2/31))+(2/31)<FONT face=arial 
size=2>ee=(CC*DD)^2<FONT face=arial 
size=2>ff=(C-Ref(C,-1))<FONT face=arial 
size=2>Sig:=If(Cum(1)=5, Ref(C,-1)+EE*FF, PREV + EE * (C - 
PREV)) <FONT face=arial 
size=2>Regards Bernard 
BouréeYour use of Yahoo! Groups is subject to 
the Yahoo! Terms of 
Service. Your 
use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service.