N1:=102;
M:=7;
VAR2:=CLOSE*VOL;
VAR3:=EMA((EXPMA(VAR2,3)/EXPMA(VOL,3)+EXPMA(VAR2,6)/EXPMA(VOL,6)
+EXPMA(VAR2,12)/EXPMA(VOL,12)+EXPMA(VAR2,24)/EXPMA(VOL,24))/4,13);
SUP:=1.06*VAR3,COLORLIGREEN;
SDN:=VAR3*0.94,COLORLIGREEN;
VAR4:=EXPMA(CLOSE,9);
LUP:=EXPMA(VAR4*1.14,5),COLORBLUE;
LDN:=EXPMA(VAR4*0.86,5),COLORBLUE;
AAX:=MA((2*CLOSE+HIGH+LOW)/4,5);
TD1:=AAX*N1/100,LINETHICK2,COLORYELLOW;
TD2:=AAX*(200-N1)/100,LINETHICK2,COLORYELLOW;
CC:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);
DD:=DMA(CLOSE,CC);
TD3:=(1+M/100)*DD,LINETHICK2,COLORMAGENTA;
TD4:=(1-M/100)*DD,LINETHICK2,COLORMAGENTA;
BOLL:=MA(CLOSE,20),COLORCYAN;
UB:=BOLL+2*STD(CLOSE,20),COLORGREEN,LINETHICK4;
LB:=BOLL-2*STD(CLOSE,20),COLORBLUE,LINETHICK4;
ENTERLONG:=CROSS(CLOSE,LB);
EXITLONG:=CROSS(CLOSE,UB);
OK:=L<=SDN AND L<=LDN AND L<=TD2 AND L<=TD4 AND O<=C AND CROSS(CLOSE,LB);
XG:FILTER(OK,10);