--- In [email protected], "miche1a" <[EMAIL PROTECTED]> wrote:
>
> Just starting with amibroker , In metastock I use this cycle 
indicator 
> and want to convert it in amibroker language, one in 9 period and 
one 
> in 15 period , here is the exemple of the 15 period
> 
> Period:= 15;
>       denom1:= If(HHV(H,Period)-LLV(L,Period)>0, HHV(H,Period)-LLV
> (L,Period), 1);
>       P1:= Mov(((C-LLV(L,Period))/ denom1)*100,3,E);
>       denom2 := If(HHV(P1,Period)-LLV(P1,Period)>0, HHV(P1,Period)-
LLV
> (P1,Period), 1);
>       Mov(((P1-LLV(P1,Period))/denom2)*100,3,E)
> 
> Thank's in advance
>
Period1= 15;
denom1= IIf(HHV(H,Period1)-LLV(L,Period1)>0, HHV(H,Period1)-LLV
(L,Period1), 1);
P1= EMA(((C-LLV(L,Period1))/ denom1)*100,3);
denom2= IIf(HHV(P1,Period1)-LLV(P1,Period1)>0, HHV(P1,Period1)-LLV
(P1,Period1), 1);
Plot(EMA(((P1-LLV(P1,Period1))/denom2)*100,3),"", colorRed);

Period2= 9;
denom1= IIf(HHV(H,Period2)-LLV(L,Period2)>0, HHV(H,Period2)-LLV
(L,Period2), 1);
P1= EMA(((C-LLV(L,Period2))/ denom1)*100,3);
denom2= IIf(HHV(P1,Period2)-LLV(P1,Period2)>0, HHV(P1,Period2)-LLV
(P1,Period2), 1);
Plot(EMA(((P1-LLV(P1,Period2))/denom2)*100,3),"", colorBlue);

or you can use this:

Period= Param( "Periods", 15, 1, 200, 1 );
denom1= IIf(HHV(H,Period)-LLV(L,Period)>0, HHV(H,Period)-LLV
(L,Period), 1);
P1= EMA(((C-LLV(L,Period))/ denom1)*100,3);
denom2= IIf(HHV(P1,Period)-LLV(P1,Period)>0, HHV(P1,Period)-LLV
(P1,Period), 1);
Plot(EMA(((P1-LLV(P1,Period))/denom2)*100,3),"", colorRed);

Better still: use StochK% with 14,4 or 15,5 and so on....

cheers

Reply via email to