cond1:ref(c>=o,4);
cond2:ref(all(c>ref(c,1),2),2);
cond3:ref(c=hhv(c,4),1);
12345
variable:p=0;
temp:=ref(low,2);
if cond1 and cond2 and cond3 and holding=0 then
begin
buy(1,1,marketr);
p:=temp;
END
if close<p then sell(1,holding,marketr);
if close>enterprice+20*mindiff or (enterbars>9 and close<hhv(close,9)) then sell(1,holding,marketr);