Join our facebook group for Amibroker afl code discussion https://www.facebook.com/groups/603980776889348

Dotted Support Resistance Warning Zone


Dotted Support Resistance Warning Zone
Dotted Support Resistance Warning Zone


//www.aflcode.com
Pd= Param("Max Length",13,100,30,2);

RWH= (H-Ref(L,-Pd))/(ATR(Pd)*sqrt(Pd));
RWL= (Ref(H,-Pd)- L)/(ATR(Pd)*sqrt(Pd));

Pk= WMA((RWH-RWL),3);
AVTR= MA(HHV(H,2) - LLV(L,2),20);
SD= StDev(HHV(H,2) - LLV(L,2),20);

Val4= IIf(Pk>0,HHV(H - AVTR-3.6*SD,21),LLV(L + AVTR+3*SD,21));
Val3= IIf(Pk>0,HHV(H - AVTR-2.2*SD,10),LLV(L + AVTR+2*SD,10));
Val2= IIf(Pk>0,HHV(H - AVTR-1.0*SD,30),LLV(L + AVTR+SD,30));
Val1= IIf(Pk>0,HHV(H - AVTR,21),LLV(L + AVTR,21)); 

Plot(Val4,"3SDev",IIf(Val4 > C OR Val4 < Ref(Val4,-1),34,42),24);
Plot(Val3,"2SDev",IIf(Val3 > C OR Val3 < Ref(Val3,-1),16,34),24);
Plot(Val2,"1SDev",6,24);
Plot(Val1,"Warning",32,1);
Plot(C,"close",colorLightGrey,styleCandle); //,55,64);

Previous
Next Post »