X_1:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100; X_2:=BARSLAST(CLOSE>REF(CLOSE,1)); X_3:=COUNT(CLOSEX_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);