N:=5;N1:=10;N2:=20;DIR:=A(CLOSE-REF(CLOSE,n));VIR:=SUM(ABS(CLOSE-REF(CLOSE,1)),n);ER:=DIR/VIR;CS:=ER*(2/3-2/31)+2/31;CQ:=CS*CS;AMA:DMA(CLOSE,CQ), COLORWHITE,linethick1;DIR1:=ABS(CLOSE-REF(CLOSE,n1));VIR1:=SUM(ABS(CLOSE-REF(CLOSE,1)),n1);ER1:=DIR1/VIR1;CS1:=ER1*(2/3-2/31)+2/31;CQ1:=CS1*CS1;AMA10:DMA(CLOSE,CQ1),COLORYELLOW,linethick2;DIR2:=ABS(CLOSE-REF(CLOSE,n2));VIR2:=SUM(ABS(CLOSE-REF(CLOSE,1)),n2);ER2:=DIR2/VIR2;CS2:=ER2*(2/3-2/31)+2/31;CQ2:=CS2*CS2;AMA20:DMA(CLOSE,CQ2),COLORGREEN,linethick3;P