Kase KCD Per1:=Input("max length",1,100,8); RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov(Mov((RWH-RWL),3,W),3,S); KCD:=PK-Mov(PK,8,S); MN:=Mov(KCD,Per1,S); SD:=Stdev(KCD,Per1); Val1:=If(MN+(1.33*SD)>2.08,MN+(1.33*SD),2.08); Val2:=If(MN-(1.33*SD)<-1.92,MN-(1.33*SD),-1.92); LN:=If(Ref(KCD,-1)>=0 AND KCD>0,Val1,If(Ref(KCD,-1)<=0 AND KCD<0,Val2,0)); Red:=If(Ref(KCD,-1)>KCD,KCD,0); Green:=If(KCD>Ref(KCD,-1),KCD,0); Red;Green;LN; *****KCD***** Per1:=Input("max length",1,100,8); RWH:=(H-Ref(L,-Per1))/(ATR(Per1)*Sqrt(Per1)); RWL:=(Ref(H,-Per1)-L)/(ATR(Per1)*Sqrt(Per1)); Pk:=Mov(Mov((RWH-RWL),3,W),3,S); KCD:=PK-Mov(PK,8,S); MN:=Mov(KCD,Per1,S); SD:=Stdev(KCD,Per1); Val1:=If(MN+(1.33*SD)>2.08,MN+(1.33*SD),2.08); Val2:=If(MN-(1.33*SD)<-1.92,MN-(1.33*SD),-1.92); LN:=If(Ref(KCD,-1)>=0 AND KCD>0,Val1,If(Ref(KCD,-1)<=0 AND KCD<0,Val2,0)); Red:=If(Ref(KCD,-1)>KCD,KCD,0); Green:=If(KCD>Ref(KCD,-1),KCD,0); Red;Green;LN; The values of red and green are the KCD. It is just for a display, You will have to change the colors, once the indicator is plotted, using the color bar, select one rising line and color it green and then change the style to plot as a histogram. Once you have finished aranging your chart, save it as a template