N:=7;
D:=28;
TYP:=(HIGH+LOW+CLOSE)/3;
QX1:=(TYP-MA(TYP,N))/(0.015*AVEDEV(TYP,N)) COLORWHITE;
QX3:=(TYP-MA(TYP,D))/(0.015*AVEDEV(TYP,D)) COLORRED;
A1:=HHV(QX3,BArslAST(crOSS(-180,QX3))+1)<100;
A2:=HHV(QX1,BARSLAST(CROSS(QX1,-100))+1)-HHV(QX3,BARSLAST(CROSS(QX1,-100))+1)>100;
A3:=HHV(QX1,BARSLAST(CROSS(QX3,-100))+1)-HHV(QX3,BARSLAST(CROSS(QX3,-100))+1)>100;
A4:=A2 OR A3;
A5:=REF(QX1,1)<QX1 AND REF(QX1,1)<-100;
A6:=REF(QX3,1)<QX3 AND REF(QX3,1)<-100;
A7:=A6 OR A5;
XGSC:A1 AND A4 AND A7;