Easy but A little Bit Confusing For Me(Help needed..!!)

#1
Hi Friends,

I have a small trouble with respect to AFL code belove...
I'm a little bit good at MetaStock but not at AFL....

Can any friend correct this code into the working style...
I think I'm confused at the line B=......... or else....




A=EMA(V,20);
B=StdDv(A,200);
Z=A+B;
Plot( Z,”Z",colorBlue, Stylethick);
 
#2
Not sure what you are trying to do, but if results do not match, test with

STDEVP

else post MS code so that some one can see what its all about

Hi Friends,

I have a small trouble with respect to AFL code belove...
I'm a little bit good at MetaStock but not at AFL....

Can any friend correct this code into the working style...
I think I'm confused at the line B=......... or else....




A=EMA(V,20);
B=StdDv(A,200);
Z=A+B;
Plot( Z,Z",colorBlue, Stylethick);
 

asnavale

Well-Known Member
#3
Hi Friends,

I have a small trouble with respect to AFL code belove...
I'm a little bit good at MetaStock but not at AFL....

Can any friend correct this code into the working style...
I think I'm confused at the line B=......... or else....




A=EMA(V,20);
B=StdDv(A,200);
Z=A+B;
Plot( Z,”Z",colorBlue, Stylethick);
Hi,

This is the code:

A = EMA(V, 20);
B = STDEV(A, 200);
Z = A + B;
Plot(Z, "Z", colorBlue, styleThick);

However I have a doubt. The Std. Dev B may be for a period of 20 and not 200 because the Average is taken for a period 20. Therefore, the Std Dev may also be for a period 20. In that case make the second Line as:

B = STDEV(A, 20);


Regards

-Anant
 
#4
Dear Amibroker Master(s),

I really need the below MS Indicator code to get converted
to the AFL code...Is this possible or not...???
I just wanted to know about that...
Best Regards,

***********************************************
P1:=Input(" period",1,100,9);
Pr:=(H+L+2*C)/4;
MA:=Mov(Pr,P1,TRI);
Shift:=Round(P1/2);
center:=LastValue(Shift);
CMA:=Ref(MA,center);
y:=LastValue(CMA+PREV-PREV);
CMA:=If(y>0,y,Pr);
CMA1:=Ref(Mov(Pr,P1-1,TRI),center-1);
y:=LastValue(CMA1+PREV-PREV);
CMA1:=If(y>0,y,Pr);
CMA2:=Ref(Mov(Pr,P1-2,TRI),center-2);
y:=LastValue(CMA2+PREV-PREV);
CMA2:=If(y>0,y,Pr);
CMA3:=Ref(Mov(Pr,P1-3,TRI),center-3);
y:=LastValue(CMA3+PREV-PREV);
CMA3:=If(y>0,y,Pr);
CMA4:=Ref(Mov(Pr,P1-4,TRI),center-4);
y:=LastValue(CMA4+PREV-PREV);
CMA4:=If(y>0,y,Pr);
CMA5:=Ref(Mov(Pr,P1-5,TRI),center-5);
y:=LastValue(CMA5+PREV-PREV);
CMA5:=If(y>0,y,Pr);

CMAP:=
If(Cum(1)=LastValue(Cum(1)-center+1),CMA1,
If(Cum(1)=LastValue(Cum(1)-center+2),CMA2,
If(Cum(1)=LastValue(Cum(1)-center+3),CMA3,
If(Cum(1)=LastValue(Cum(1)-center+4),CMA4,
If(Cum(1)=LastValue(Cum(1)-center+5),CMA5,CMA)))));
CMAP;Mov(CMAP,4,E);
 
Last edited:

Similar threads