X_1:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100;
X_2:=BARSLAST(CLOSE>REF(CLOSE,1));
X_3:=COUNT(CLOSE<REF(CLOSE,1),X_2)=X_2-1 AND LLV(CLOSE,X_2)<=HHV(MAX(CLOSE,OPEN),X_2)*0.95 OR REF(X_1,1)<=(-5);
X_4:=CLOSE>=OPEN AND CLOSE>=REF((OPEN+CLOSE)/2,1);
X_5:=REF(X_3,1) AND X_4;
XG:CROSS(X_5,0.5);