EMA Slope for Amibroker (AFL)
wisp almost 9 years ago Amibroker (AFL)
EMA color changes based on slope
Screenshots
Indicator / Formula
Copy & Paste Friendly
P = Param("EMA PERIOD",20,2,90,1);
q = Param("WINDOW SIZE FOR CALCULATING SLOPE", 1,1,20,1);
r = Param("SLOPE CHANGE SMOOTHING FACTOR",5,1,50,1);
e = EMA(C, P);
Slope = atan((e - Ref(e,-q)) / (q * 3.14159265)) * 180;
m = MA(Slope,r);
Plot(Slope,"Slope", IIf(Slope>0,colorBlue,colorRed),styleHistogram|styleThick);
Plot(m,"Direction",IIf(m>Ref(m,-1),colorBlue,colorRed),styleThick);4 comments
Leave Comment
Please login here to leave a comment.
Good!
Thank you.
Nice one.Thanks
hi;
how did you reach to this:
Slope = atan((e - Ref(e,-q)) / (q * 3.14159265)) * 180;any link on web?
Just wanted to say thanks! BTW you can make the direction line in front by changing the z-order:
Plot(m,“Direction”,IIf(m>Ref(m,-1),colorBlue,colorRed),styleThick,Null,Null,Null,1);