value_a1:=(close-ref(close,1))/ref(close,1)*100;
value_a2:=(high-low)/low*100;
value_a3:=open+(close-open)*0.5;
value_a4:=ref(value_a1>=6,1) and value_a2<=5 and close>=ref(value_a3,1);
value_a5:=ref(value_a3,barslast(value_a4)+1);
value_a6:=value_a5*1.1;
value_b1:=cross(close,value_a6);
value_b2:=barslast(value_a4)-barslast(value_b1);
value_b3:=if(value_b2>0,value_b2,drawnull);
value_b4:=count(between(close,value_a5,value_a6) and value_a2<=5,value_b3)=value_b3;
value:ref(value_b4 and value_b3>=2,1) and value_b1;